地图摘录:
<entity class= "org.sm.EndpointList" >
<table name= "ENDPOINT_LIST" />
<attributes>
...
<many-to-many name= "endpoints">
<join-table name= "ENDPOINT_LIST_TO_ENDPOINTS" >
<join-column name= "fk_endpoint_list_id" nullable= "false" />
<inverse-join-column name= "fk_endpoint_id" nullable= "false" />
<unique-constraint>
<column-name> fk_endpoint_list_id</column-name >
<column-name> fk_endpoint_id</column-name >
</unique-constraint>
</join-table>
<cascade>
<cascade-all />
</cascade>
</many-to-many>
</attributes>
</entity >
<entity class="org.sm.Endpoint">
<table name= "ENDPOINTS"/>
<attributes>
...
</attributes>
</entity >
如果他决定执行
,如何指定Hibernate的映射DELETE FROM ENDPOINTS WHERE id = 123
之前他必须执行
DELETE FROM ENDPOINT_LIST_TO_ENDPOINTS WHERE fk_endpoint_id = 123
答案 0 :(得分:0)