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
|