Joined: Wed Oct 15, 2003 3:20 pm Posts: 9 Location: Montreal
|
Hi I have a group which contains a set of groupReports. When I do a session.delete(group), Id like all its child to be delete as well but it seems to send an update on the child table instead of a delete.
Here is my mapping
--------------Parent
<class name="cgix.trust.domain.PtbnGroup" schema="PTBN" table="PTBN_GROUP" dynamic-update="true">
<id column="GROUP_ID" name="groupId" type="java.lang.Long" unsaved-value="null">
<generator class="sequence" >
<param name="sequence">PTBN_SEQ_G</param>
</generator>
</id>
<set name="groupReports" table="PTBN_GROUP_REPORT" lazy="false" cascade="delete">
<key>
<column name="GROUP_ID" not-null="true" />
</key>
<one-to-many class="cgix.trust.domain.PtbnGroupReport"/>
</set>
-------------Child
<class name="cgix.trust.domain.PtbnGroupReport" schema="PTBN" table="PTBN_GROUP_REPORT">
<composite-id unsaved-value="none">
<key-property column="GROUP_ID" length="22" name="groupId" type="java.lang.Long"/>
<key-property column="REPORT_ID" length="22" name="reportId" type="java.lang.Long"/>
</composite-id>
<version
column="LAST_MODIFICATION_DATE"
name="lastModificationDate"
type="java.sql.Timestamp"
/>
Thanks in advance
|
|