• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in Entity Relationship Persistence

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Consider the following example below where Department and Employee are entities with a relationship where in many employees belong to a department with a bidirectional directionality:


The question is when I call persist on the Employee instance, will the Department entity also be automatically be written to the database? Here the Employee is the owning side of the relationship and the Department is the inverse side of the relationship.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OOPS... Just thought about the cascade policies. But what would be the default?
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that the default for cascade is: not to cascade
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic