grumpy wrote:
1. load the correct ChildTypeOne record, by using the Parent object's (CHILD_TYPE_ONE_ID + SESSION_ID) columns
2. load the set of ChildTypeTwo records, using the Parent object's (ID + SESSION_ID) columns
FYI - I'm using Hibernate 3.2
Thanks in advance.
1.
Code:
<set name="childTypeOne">
<key column="child_type_one_id" property-ref="childTypeOneId"/>
<key column="sessionId" property-ref="sessionId "/>
<one-to-many class="ChildTypeOne"/>
</set>
2.
Code:
<set name="childTypeTwo">
<key column="parent_id" property-ref="id"/>
<key column="session_id" property-ref="sessionId "/>
<one-to-many class="ChildTypeTwo"/>
</set>
Note childTypeOneId, sessionId and id in property-refs refer to properties in the parent class.
Farzad-