Given the mapping below, how come a deleting a "parent", SupplierModel, doesn't cascade to deleting the "child", SupplierCarrierModel? It works if I make SupplierCarrierModel a composite-element of SupplierModel, but then other things didn't work. Is there any reason why this isn't working??
Code:
<hibernate-mapping>
<class
name="SupplierModel"
table="PLDT_SUP"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="supplierNumber"
column="NBR_BSA_SUP"
type="java.lang.String"
>
<generator class="assigned">
</generator>
</id>
<property
name="supplierName"
type="java.lang.String"
update="true"
insert="true"
column="NME_BSA"
/>
<set
name="supplierCarriers"
table="PAMT_SUP_CAR"
lazy="true"
inverse="true"
cascade="delete"
sort="unsorted"
>
<key
column="NBR_BSA_SUP"
/>
<one-to-many
class="SupplierCarrierModel"
/>
</set>
</class>
<class
name="SupplierCarrierModel"
table="PAMT_SUP_CAR"
dynamic-update="false"
dynamic-insert="false"
>
<composite-id
name="id"
class="SupplierCarrierModelKey"
>
<key-many-to-one
name="supplier"
class="SupplierModel"
column="NBR_BSA_SUP"
/>
<key-many-to-one
name="carrier"
class="CarrierModel"
column="NBR_CAR"
/>
<key-many-to-one
name="product"
class="ProductModel"
column="CDE_PRD_GRD"
/>
</composite-id>
<!-- more properties... -->
</class>