wiki:Cascading

What Hibernate cascading mode is used as much as possible? This mode is specified per cardinality in the hibernate mapping.

Option 1: save-update

  • + no resources gets magically deleted
  • - resources do remain

Option 2: all

  • + related resources are always cleaned uyp
  • - magic deletion which might not be desirable

Chosen option 2 I ran into the situation that I was inserting and deleting. The thing is that with option 1, Hibernate does not delete the related resources. Therefore I have chosen for option 2. Note thought that this can be differentiated per entity.

Last modified 15 years ago Last modified on Dec 19, 2008, 7:22:40 AM
Note: See TracWiki for help on using the wiki.