-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Parent child and list
PostPosted: Wed Jun 27, 2007 11:44 am 
Beginner
Beginner

Joined: Thu Aug 19, 2004 5:36 am
Posts: 30
Location: Italy
Hibernate version: 3.2.4.sp1

Despite (or... in consequence of..) an accurate reading of on line documentation, the book of Christian Bauer and Gavin King (2nd edition) and a long long search in the forum, i can say that..

I've nothing understood. I'm in total confusion.

I have to implement a large number of parent-child structures in a web application.
I need the long-conversation approach, so I can work with parent and child editing (and add and remove childs, of course); so:
- FlushMode.MANUAL
- one Session at the beginning of the work (the time of parent loading or creation)
- session disconnection/reconnection for the "user think time"
and so on.

In this scenario I cannot figure out other way to manage a child collection than as a List (ArrayList):
I need to manage childs that are created and that lives only in memory until the final persist, and so I NEED an index to pick and edit them because the surrogate key is not present before that time (no: I have not sequence in db) and I have no other handle than the index of the child in the collection.
Sometimes parent and childs are legacy tables with composite id.
I have to add that I need a reference to parent in the child.

So. Some questions:

1) I've often red in the forum that lists are not a good structure, but how can I handle a similar situation without lists? I think that this is a quite common need, and any suggestion will be greatly appreciated.

2) Index property getter/setter in the child: who have to manage it? There was a workaround (http://www.hibernate.org/193.html) for it, but this was for Hibernate 2. Is it still valid for Hibernate 3 or I must expect disasters in using it? (At the moment some structures are mapped in this way and it seems that they work correctly, but...).
Is there a standard correct approach of definefor Hibernate 3?

Thank you very much


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.