• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is cascading save in Hibernate

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is cascading save in Hibernate?
is it same as Dirty checking?
 
Mazer Lao Tzu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, cascade is not the same as dirty checking. It specifies what actions to perform on child objects.
Hibernate has some excellent online documentation. Here is a section that explains the different cascade operations: hibernate doc
 
Victor Dolirio
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just for sake of demonstration, if you have a modeling with a class Person and this class have a reference to an Address, you can do something like this:



As you can see isn't necessary to save the address before adding it to person. Hibernate automaticaly saves it for you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic