This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA: Cascade delete for join tables with composite key

 
kombi katisha
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having an issue where I have table B has a manytomany relationship to table C and table D. I am using a table B_has_C_and_D to link.

I would like to be able to delete a row in table C and have the relationship also delete the row in table "B_has_C_and_D"

Entity B:

Entity bHasCAndD:

Entity C:

Entity D:


I figure I have something just misconfigured. Anyone have any ideas/recommendations?
 
James Sutherland
Ranch Hand
Posts: 553
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the issue? What error or incorrect behavior are you seeing?

In general the cascade=ALL should cause the related B_C_D object to be deleted if you call remove() on C.
What is your code doing exactly?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic