I have a mapping (only important parts):
<class name="xyz.Role" table="ROLE" lazy="true"> <id name="id" type="java.lang.Integer"> <column name="ROLE_ID"/> <generator class="increment"/> </id> <set name="assignments" lazy="true" table="PERSON_ROLE" cascade="delete" inverse="true"> <key column="ROLE_ID" /> <many-to-many class="xyz.Person" column="PERSON_ID" /> </set> </class>
and
<class name="xyz.Person" table="PERSON" lazy="true"> <id name="Id" type="java.lang.Integer"> <column name="TPP_ID"/> <generator class="increment"/> </id> <set name="roles" lazy="true" table="PERSON_ROLE" cascade="save-update"> <key column="PERSON_ID" /> <many-to-many class="xyz.Role" column="ROLE_ID" /> </set> </class>
With this mapping, when I delete a role, very person with this role is also deleted. What I would like to achieve, is delete the association (row from PERSON_ROLE table) when I delete Role. Is there any way to achieve this?