Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • none - do not do any cascades, let the users handles them by themselves.
  • save-update - when the object is saved/updated, check the associations and save/update any object that require it (including save/update the associations in many-to-many scenario).
  • delete - when the object is deleted, delete all the objects in the association.
  • delete-orphan - when the object is deleted, delete all the objects in the association. In addition to that, when an object is removed from the association and not associated with another object (orphaned), also delete it. Orphan only checks one relation
  • all - when an object is save/update/delete, check the associations and save/update/delete all the objects found.
  • all-delete-orphan - when an object is save/update/delete, check the associations and save/update/delete all the objects found. In additional to that, when an object is removed from the association and not associated with another object . (orphaned) (using the same relation), also delete itdelete it. So 're-parenting' (changing parent) is a problem.

A note about orphan cascade:
Orphan only looks at one relation instance at a time. So a composite structure might have a list of child structures. When a child structure is removed from the CS and it is not added to another CS it is considered an orphan. NHibernate does not care about other relation the structure might have (for example with branch or a new CS).