Package org.hibernate.engine
Class CascadeStyle
java.lang.Object
org.hibernate.engine.CascadeStyle
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CascadeStyle.MultipleCascadeStyle
A contract for defining the aspects of cascading various persistence actions.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CascadeStylesave / delete / update / evict / lock / replicate / merge / persiststatic final CascadeStylesave / delete / update / evict / lock / replicate / merge / persist + delete orphansstatic final CascadeStyledeletestatic final CascadeStyledelete + delete orphansstatic final CascadeStyleevictstatic final CascadeStylelockstatic final CascadeStylemergestatic final CascadeStyleno cascadesstatic final CascadeStylecreatestatic final CascadeStylerefreshstatic final CascadeStylereplicatestatic final CascadeStylesave / update -
Method Summary
Modifier and TypeMethodDescriptionabstract booleandoCascade(CascadingAction action) For this style, should the given action be cascaded?static CascadeStylegetCascadeStyle(String cascade) Factory method for obtaining named cascade stylesbooleanDo we need to delete orphaned collection elements?booleanreallyDoCascade(CascadingAction action) Probably more aptly named something like doCascadeToCollectionElements(); it is however used from both the collection and to-one logic branches...
-
Field Details
-
ALL_DELETE_ORPHAN
save / delete / update / evict / lock / replicate / merge / persist + delete orphans -
ALL
save / delete / update / evict / lock / replicate / merge / persist -
UPDATE
save / update -
LOCK
lock -
REFRESH
refresh -
EVICT
evict -
REPLICATE
replicate -
MERGE
merge -
PERSIST
create -
DELETE
delete -
DELETE_ORPHAN
delete + delete orphans -
NONE
no cascades
-
-
Method Details
-
doCascade
For this style, should the given action be cascaded?- Parameters:
action- The action to be checked for cascade-ability.- Returns:
- True if the action should be cascaded under this style; false otherwise.
-
reallyDoCascade
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 returndoCascade(org.hibernate.engine.CascadingAction); for certain styles (currently only delete-orphan), however, we need to be able to control this seperately.- Parameters:
action- The action to be checked for cascade-ability.- Returns:
- True if the action should be really cascaded under this style; false otherwise.
-
hasOrphanDelete
public boolean hasOrphanDelete()Do we need to delete orphaned collection elements?- Returns:
- True if this style need to account for orphan delete operations; false othwerwise.
-
getCascadeStyle
Factory method for obtaining named cascade styles- Parameters:
cascade- The named cascade style name.- Returns:
- The appropriate CascadeStyle
-