「グループ」と「顧客」の 2 つのテーブルと、もちろん「グループ」と「顧客」の 2 つのエンティティがあります。そして、「CustomerGroupMember」テーブルの両方を参照している別のテーブルがあります。
多対多のマッピングには CustomerGroupMember テーブルを使用します。
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>
「CustomerGroupMember」テーブルのエンティティとマッピングを作成していません。
私の質問は、CustomerGroupMember テーブルから CustomerGroupMember を削除するにはどうすればよいですか? CustomerGroupMember を削除するには、CustomerGroupMember のエンティティを作成する必要がありますか?それとも別の方法がありますか?
どうもありがとうございました。