public abstract class

CascadeStyle

extends Object
implements Serializable
java.lang.Object
   ↳ org.hibernate.engine.CascadeStyle
Known Direct Subclasses

Class Overview

A contract for defining the aspects of cascading various persistence actions.

See Also

Summary

Nested Classes
class CascadeStyle.MultipleCascadeStyle  
Fields
public static final CascadeStyle ALL save / delete / update / evict / lock / replicate / merge / persist
public static final CascadeStyle ALL_DELETE_ORPHAN save / delete / update / evict / lock / replicate / merge / persist + delete orphans
public static final CascadeStyle DELETE delete
public static final CascadeStyle DELETE_ORPHAN delete + delete orphans
public static final CascadeStyle EVICT evict
public static final CascadeStyle LOCK lock
public static final CascadeStyle MERGE merge
public static final CascadeStyle NONE no cascades
public static final CascadeStyle PERSIST create
public static final CascadeStyle REFRESH refresh
public static final CascadeStyle REPLICATE replicate
public static final CascadeStyle UPDATE save / update
Public Methods
abstract boolean doCascade(CascadingAction action)
For this style, should the given action be cascaded?
static CascadeStyle getCascadeStyle(String cascade)
Factory method for obtaining named cascade styles
boolean hasOrphanDelete()
Do we need to delete orphaned collection elements?
boolean reallyDoCascade(CascadingAction action)
Probably more aptly named something like doCascadeToCollectionElements(); it is however used from both the collection and to-one logic branches...
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final CascadeStyle ALL

save / delete / update / evict / lock / replicate / merge / persist

public static final CascadeStyle ALL_DELETE_ORPHAN

save / delete / update / evict / lock / replicate / merge / persist + delete orphans

public static final CascadeStyle DELETE

delete

public static final CascadeStyle DELETE_ORPHAN

delete + delete orphans

public static final CascadeStyle EVICT

evict

public static final CascadeStyle LOCK

lock

public static final CascadeStyle MERGE

merge

public static final CascadeStyle NONE

no cascades

public static final CascadeStyle PERSIST

create

public static final CascadeStyle REFRESH

refresh

public static final CascadeStyle REPLICATE

replicate

public static final CascadeStyle UPDATE

save / update

Public Methods

public abstract boolean doCascade (CascadingAction action)

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.

public static CascadeStyle getCascadeStyle (String cascade)

Factory method for obtaining named cascade styles

Parameters
cascade The named cascade style name.
Returns
  • The appropriate CascadeStyle

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.

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.

Parameters
action The action to be checked for cascade-ability.
Returns
  • True if the action should be really cascaded under this style; false otherwise.