Hi,
Shop has a set of contacts. it is the many to many relationship.
i added an rel_obj_contact as relationtable which contains objid(shopid), contactid and relationtypeid.
ObjectContact is a compositeElement wrapping 1 contact and 1 relationtype.
The PROBLEM is, if i delete a shop, the relationship item in rel_obj_contact will not be deleted. (i want the relationship in my database deleted)
How can I implement it?
Code:
<Shop...>
<set name="shopContacts"
table="REL_OBJ_CONTACT"
cascade="all"
lazy="false">
<key column="OBJID"/>
<composite-element class="ObjectContact">
<many-to-one name="contact"
column="contactid"
class="Contact"
cascade="save-update"/>
<many-to-one name="relationType"
column="relationid"
not-found="ignore"
class="RelationType"
cascade="save-update"/>
</composite-element>
</set>
...
</Shop>