Hi,
I would be very greatful if anyone would be happy to share their insight with me on this question.
I have the following tables:
territory
territory_person
person
The idea is that one person can belong to several territories. I have mapped Person to Territory like this:
Code:
<set name="territories" lazy="false" table="territory_person" cascade="none">
<key column="person_id"/>
<many-to-many column="territory_id" class="database.entities.Territory" />
</set>
Territory is mapped without any references to person, as i want to avoid generating too many queries.
However, how would i go about so that every time i delete a territory, the association between the territory and the person would automatically be removed? As i see it right now, i would have to issue a manual SQL query for that...?
Any other ideas?