Hi all,
I have a (user|group)-group relationship, which is many-to-many
and of course one side is mapped reverse ( user|group side )
to prevent double inserts.
respective mapping is:
Code:
<set name="groupsSet" lazy="true" inverse="true" cascade="none" table="groups">
<key column="member_id"/>
<many-to-many column="group_id" class="com.infodesire.user.hibernate.GroupImpl"/>
</set>
<subclass discriminator-value="group" name="com.infodesire.user.hibernate.GroupImpl" proxy="com.infodesire.user.hibernate.GroupImpl">
<set name="membersSet" lazy="true" cascade="none" table="groups">
<key column="group_id"/>
<many-to-many column="member_id" class="com.infodesire.user.hibernate.EntityImpl"/>
</set>
</subclass>
Now I would like to be able to just remove group or user object
and have all their relationships also removed, but not cascaded to entity on the other side
( removal of user leads to expulsion in all the groups and removal of group does the same )
What cascade option shall I use?
regards,