• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JPA: Cascade delete for join tables with composite key

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
What are you saying? I thought you said that Santa gave you that. And this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic