-->
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.  [ 2 posts ] 
Author Message
 Post subject: Can parents map children more than once?
PostPosted: Tue May 11, 2004 12:30 pm 
Regular
Regular

Joined: Fri Aug 29, 2003 12:48 pm
Posts: 63
Hey guys, a random question came to me the other day. I've got a parent with an ordered bunch of children mapped in a List. Occasionally, I would like to be able to find a child with a specific name. Yes, I know I can use the session.filter() method on the collection, and that's probably what I will end up doing, but another solution occured to me as well. Could the parent map the children both using a List, indexed by position, and using a Map, indexed by name?

If so, could both collections be mapped with cascade="all" or "all-delete-orphan"? Is this pattern particularly bad for any reason?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 11, 2004 12:59 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
you'd have to map one with insert=false, update=false. And I don't think it is very elegant - and leads to unnecessary queries, and is therefore a bad idea i'd say.


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

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.