我有两个表“组”和“客户”,当然还有两个实体“组”和“客户”。我有另一个表,它同时引用了“CustomerGroupMember”表。
我使用 CustomerGroupMember 表进行多对多映射。
客户.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>
组.hbm.xml
<bag name="Members" table="CustomerGroupMember" cascade="all" lazy="true">
<key column="CustomerGroupId" />
<many-to-many class="Customer" column="CustomerId" />
</bag>
我还没有为“CustomerGroupMember”表创建实体和映射。
我的问题是如何从 CustomerGroupMember 表中删除 CustomerGroupMember?我需要为 CustomerGroupMember 创建一个实体才能删除 CustomerGroupMember 还是有其他方法?
非常感谢你。