Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • 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
  • 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".
 
Rototillers convert rich soil into dirt. Please note that this tiny ad is not a rototiller:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic