Hi,
I have a set of tables, and associations between these tables as seperate tables containing a uni-directional many-to-one. If i have table A and B, and an association table AB, then table AB contains references to A and B, but A and B does not know about the AB table.
The references are mapped in AB as:
<many-to-one name="a" column="a" class="A" />
and the same for B. My problem occurs upon deleting objects. The way i would like it to work, is that when an entry in A or B is deleted, all entries in AB referencing this entry is deleted as well. I have tried using cascade="delete" on my many-to-one mappings, but this works in the wrong "direction", deleting all referenced objects when deleting an entry in AB.
Is there a way to achieve this without having to include a one-to-many mapping with a corresponding set in the referenced object?
- Tobb
|