• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Should CASCADE only be specified on the owner side of a bi-directional relationship ?

 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suppose I have a bi-directional for many-to-many or one-to-many relation (i.e. each side have access to the other).  For many-to-many and one-to-many there is always an "owner" and a non-owner.  Should "CASCADE" only be specified on the owner side ?  what happens if

1) CASCADE is specified on both owner and non owner side ?
2) CASCADE is specified on non owner side only ?

Note: we are talking about bi-direction only.

Thanks.
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Linwood Hayes wrote:Should "CASCADE" only be specified on the owner side ?  what happens if

1) CASCADE is specified on both owner and non owner side ?
2) CASCADE is specified on non owner side only ?


You might want to read the beginner’s guide to JPA and Hibernate Cascade Types by Vlad Mihalcea (author of the book "High Performance Java Persistence".
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic