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 16 years ago Last modified on 12/19/08 07:22:40
Note: See TracWiki for help on using the wiki.