I have two tables "Group" and "Customer" and of course two entities "Group" and "Customer". And i have another table which is referencing both "CustomerGroupMember" table.
I use CustomerGroupMember table for many-to-many mapping.
Customer.hbm.xml
<!--Many to many-->
<bag name="CustomerGroups" table="CustomerGroupMember" cascade="all" lazy="true">
<key column="CustomerId" />
<many-to-many class="CustomerGroup" column="CustomerGroupId" />
</bag>
Group.hbm.xml
<bag name="Members" table="CustomerGroupMember" cascade="all" lazy="true">
<key column="CustomerGroupId" />
<many-to-many class="Customer" column="CustomerId" />
</bag>
I haven't created an entity and mapping for "CustomerGroupMember" table.
My question is how can i delete a CustomerGroupMember from CustomerGroupMember table ? Do i need to create an entity for CustomerGroupMember in order to delete CustomerGroupMember or there is another way ?
Thank you very much.