Expert |
|
Joined: Fri Jan 30, 2009 1:47 am Posts: 292 Location: Bangalore, India
|
I think you can achieve this with the <idbag> mapping.
<class name="Parent" table="Parent">
<id name="id" column="ID" unsaved-value="0">
<generator class="native" />
</id>
<property name="name" />
.......
.......
<idbag name="children" table="ParentChild" lazy="false" cascade="all">
<collection-id type="long" column="PAR_CHD_ID">
<generator class="sequence"/>
</collection-id>
<key column="PAR_ID"/>
<many-to-many class="Child" column="CHILD_ID"/>
</idbag>
</class>
_________________ Regards, Litty Preeth
|
|