Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

orphan child for Many To Many mappings  RSS feed

 
Ranch Hand
Posts: 630
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One to one and one to many relationships, if a parent has been deleted, you can set  orphanRemoval true. Will delete the orphan child.

But it seems there is to no way within JPA to remove the orphan for a many to many parent.
I feel the best way is to periodically run amother programme on the DB itself dedicated to removing orphans

Is this the best possible soultion.
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!