Hibernate: delete many-to-many association

后端 未结 2 781
野性不改
野性不改 2020-12-29 00:02

I have two tables with the many-to-many association.

— DB fragment:

loads
Id
Name

sessions
Id
Date<

2条回答
  •  情话喂你
    2020-12-29 00:32

    Looks like you just need to turn on Transitive persistence (e.g., cascade=all-delete-orphan for "full" transitive.)

    -- Edit Thanks for the upvote, althugh Pascal was accurate in that cascade alone is not enough to fix the original problem, but that both sides of the relationship weren't being managed. Teach me to answer hastily :)

    --

    Also, an Entity named Session broke my brain :(

提交回复
热议问题