Cascading can occur whenever we have relationships between entities. For example, there is a one-to-one relationship between the Customer and Referee entities in our application. By allowing a persist
operation to cascade, whenever we persist a Customer entity, the associated Referee entity is automatically persisted. There is no need to persist the Referee entity in a separate operation. By allowing a remove
operation to cascade, whenever we remove a Customer entity, the associated Referee is automatically removed.
Cacading can occur for one-to-one, one-to-many, many-to-one, and many-to-many relationships. Cascading is possible for persist, remove, merge
, and refresh
operations. There is no default cascading behavior for any operation and for any relationship.