-->
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_ID1 or PARENT_ID2
PostPosted: Thu Nov 17, 2005 5:28 am 
Newbie

Joined: Fri May 27, 2005 6:16 am
Posts: 14
Hi,

I have a child table which can have one or two parents, but 95% only one. In the db I created two fields, PARENT_ID1 and PARENT_ID2. Now, in the parent class, I would like to create a set with all its children in it, so both when its ID field is in the child's PARENT_ID1 and PARENT_ID2. Is there a way to do this in hibernate, now I create two sets (one for PARENT_ID2 and one for 2), but I would like to make one set of it.

<set name="Children" lazy="false"inverse="true">
<key column="PARENT_ID1"/> //OR PARENT_ID2
<one-to-many class="com.my.Child"/>
</set>

Regards,
Leen Toelen


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.