Top Inners Fields Constructors Methods
org.hibernate.engine.spi

public final Class CascadeStyles

extends Object
Class Inheritance
Imports
java.util.HashMap, .Map, org.hibernate.MappingException, org.hibernate.internal.util.collections.ArrayHelper, org.jboss.logging.Logger

Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
public static class

Field Summary

Modifier and TypeField and Description
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

private static final Logger
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

private static final Map<String, CascadeStyle>
public static final CascadeStyle
UPDATE

save / update

Constructor Summary

AccessConstructor and Description
private
CascadeStyles()

Disallow instantiation

Method Summary

Modifier and TypeMethod and Description
private static Map<String, CascadeStyle>
public static CascadeStyle

Returns:

The appropriate CascadeStyle
getCascadeStyle
(String
The named cascade style name.
cascade
)

Factory method for obtaining named cascade styles

public static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALLback to summary
public static final CascadeStyle ALL

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

ALL_DELETE_ORPHANback to summary
public static final CascadeStyle ALL_DELETE_ORPHAN

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

DELETEback to summary
public static final CascadeStyle DELETE

delete

DELETE_ORPHANback to summary
public static final CascadeStyle DELETE_ORPHAN

delete + delete orphans

EVICTback to summary
public static final CascadeStyle EVICT

evict

LOCKback to summary
public static final CascadeStyle LOCK

lock

logback to summary
private static final Logger log
MERGEback to summary
public static final CascadeStyle MERGE

merge

NONEback to summary
public static final CascadeStyle NONE

no cascades

PERSISTback to summary
public static final CascadeStyle PERSIST

create

REFRESHback to summary
public static final CascadeStyle REFRESH

refresh

REPLICATEback to summary
public static final CascadeStyle REPLICATE

replicate

STYLESback to summary
private static final Map<String, CascadeStyle> STYLES
UPDATEback to summary
public static final CascadeStyle UPDATE

save / update

Constructor Detail

CascadeStylesback to summary
private CascadeStyles()

Disallow instantiation

Method Detail

buildBaseCascadeStyleMapback to summary
private static Map<String, CascadeStyle> buildBaseCascadeStyleMap()
getCascadeStyleback to summary
public static CascadeStyle getCascadeStyle(String cascade)

Factory method for obtaining named cascade styles

Parameters
cascade:String

The named cascade style name.

Returns:CascadeStyle

The appropriate CascadeStyle

registerCascadeStyleback to summary
public static void registerCascadeStyle(String name, CascadeStyles.BaseCascadeStyle cascadeStyle)
org.hibernate.engine.spi back to summary

public abstract Class CascadeStyles.BaseCascadeStyle

extends Object
implements CascadeStyle
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.spi.CascadeStyle, java.io.Serializable
Known Direct Subclasses
org.hibernate.engine.spi.CascadeStyles.MultipleCascadeStyle

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
hasOrphanDelete()

Implements org.hibernate.engine.spi.CascadeStyle.hasOrphanDelete.

Do we need to delete orphaned collection elements?
public boolean
reallyDoCascade(CascadingAction
The action to be checked for cascade-ability.
action
)

Implements org.hibernate.engine.spi.CascadeStyle.reallyDoCascade.

Probably more aptly named something like doCascadeToCollectionElements(); it is however used from both the collection and to-one logic branches...
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BaseCascadeStyleback to summary
public BaseCascadeStyle()

Method Detail

hasOrphanDeleteback to summary
public boolean hasOrphanDelete()

Implements org.hibernate.engine.spi.CascadeStyle.hasOrphanDelete.

Doc from org.hibernate.engine.spi.CascadeStyle.hasOrphanDelete.

Do we need to delete orphaned collection elements?

Returns:boolean

True if this style need to account for orphan delete operations; false otherwise.

Annotations
@Override
reallyDoCascadeback to summary
public boolean reallyDoCascade(CascadingAction action)

Implements org.hibernate.engine.spi.CascadeStyle.reallyDoCascade.

Doc from org.hibernate.engine.spi.CascadeStyle.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 return doCascade; for certain styles (currently only delete-orphan), however, we need to be able to control this separately.

Parameters
action:CascadingAction

The action to be checked for cascade-ability.

Returns:boolean

True if the action should be really cascaded under this style; false otherwise.

Annotations
@Override
org.hibernate.engine.spi back to summary

public final Class CascadeStyles.MultipleCascadeStyle

extends BaseCascadeStyle
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final CascadeStyle[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
doCascade(CascadingAction
The action to be checked for cascade-ability.
action
)

Implements org.hibernate.engine.spi.CascadeStyle.doCascade.

For this style, should the given action be cascaded?
public boolean
public boolean
reallyDoCascade(CascadingAction
The action to be checked for cascade-ability.
action
)

Overrides org.hibernate.engine.spi.CascadeStyles.BaseCascadeStyle.reallyDoCascade.

Implements org.hibernate.engine.spi.CascadeStyle.reallyDoCascade.

Probably more aptly named something like doCascadeToCollectionElements(); it is however used from both the collection and to-one logic branches...
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Field Detail

stylesback to summary
private final CascadeStyle[] styles

Constructor Detail

MultipleCascadeStyleback to summary
public MultipleCascadeStyle(CascadeStyle[] styles)

Method Detail

doCascadeback to summary
public boolean doCascade(CascadingAction action)

Implements org.hibernate.engine.spi.CascadeStyle.doCascade.

Doc from org.hibernate.engine.spi.CascadeStyle.doCascade.

For this style, should the given action be cascaded?

Parameters
action:CascadingAction

The action to be checked for cascade-ability.

Returns:boolean

True if the action should be cascaded under this style; false otherwise.

Annotations
@Override
hasOrphanDeleteback to summary
public boolean hasOrphanDelete()

Overrides org.hibernate.engine.spi.CascadeStyles.BaseCascadeStyle.hasOrphanDelete.

Implements org.hibernate.engine.spi.CascadeStyle.hasOrphanDelete.

Doc from org.hibernate.engine.spi.CascadeStyle.hasOrphanDelete.

Do we need to delete orphaned collection elements?

Returns:boolean

True if this style need to account for orphan delete operations; false otherwise.

Annotations
@Override
reallyDoCascadeback to summary
public boolean reallyDoCascade(CascadingAction action)

Overrides org.hibernate.engine.spi.CascadeStyles.BaseCascadeStyle.reallyDoCascade.

Implements org.hibernate.engine.spi.CascadeStyle.reallyDoCascade.

Doc from org.hibernate.engine.spi.CascadeStyle.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 return doCascade; for certain styles (currently only delete-orphan), however, we need to be able to control this separately.

Parameters
action:CascadingAction

The action to be checked for cascade-ability.

Returns:boolean

True if the action should be really cascaded under this style; false otherwise.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override