org.hibernate.engine
Class CascadeStyle
java.lang.Object
org.hibernate.engine.CascadeStyle
- Serializable
public abstract class CascadeStyle
extends java.lang.Object
implements Serializable
A contract for defining the aspects of cascading various persistence actions.
ALL
public static final CascadeStyle ALL
save / delete / update / evict / lock / replicate / merge / persist
ALL_DELETE_ORPHAN
public static final CascadeStyle ALL_DELETE_ORPHAN
save / delete / update / evict / lock / replicate / merge / persist + delete orphans
DELETE_ORPHAN
public static final CascadeStyle DELETE_ORPHAN
delete + delete orphans
REPLICATE
public static final CascadeStyle REPLICATE
replicate
doCascade
public abstract boolean doCascade(CascadingAction action)
For this style, should the given action be cascaded?
action
- The action to be checked for cascade-ability.
- True if the action should be cascaded under this style; false otherwise.
getCascadeStyle
public static CascadeStyle getCascadeStyle(String cascade)
Factory method for obtaining named cascade styles
cascade
- The named cascade style name.
- The appropriate CascadeStyle
hasOrphanDelete
public boolean hasOrphanDelete()
Do we need to delete orphaned collection elements?
- True if this style need to account for orphan delete
operations; false othwerwise.
reallyDoCascade
public boolean reallyDoCascade(CascadingAction action)
Probably more aptly named something like doCascadeToCollectionElements(); it is
however used from both the collection and to-one logic branches...
For this style, should the given action really be cascaded? The default
implementation is simply to return
doCascade(CascadingAction)
; for certain
styles (currently only delete-orphan), however, we need to be able to
control this seperately.
action
- The action to be checked for cascade-ability.
- True if the action should be really cascaded under this style;
false otherwise.