Package org.hibernate.engine
Class CascadingAction
java.lang.Object
org.hibernate.engine.CascadingAction
A session action that may be cascaded from parent entity to its children
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CascadingActionstatic final CascadingActionstatic final CascadingActionstatic final CascadingActionstatic final CascadingActionstatic final CascadingActionExecute persist during flush timestatic final CascadingActionstatic final CascadingActionstatic final CascadingActionstatic final CascadingAction -
Method Summary
Modifier and TypeMethodDescriptionabstract voidcascade(EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) Cascade the action to the child object.abstract booleanDoes this action potentially extrapolate to orphan deletes?abstract IteratorgetCascadableChildrenIterator(EventSource session, CollectionType collectionType, Object collection) Given a collection, get an iterator of the children upon which the current cascading action should be visited.static IteratorgetLoadedElementsIterator(SessionImplementor session, CollectionType collectionType, Object collection) Iterate just the elements of the collection that are already there.voidnoCascade(EventSource session, Object child, Object parent, EntityPersister persister, int propertyIndex) Called (in the case ofrequiresNoCascadeChecking()returning true) to validate that no cascade on the given property is considered a valid semantic.booleanShould this action be performed (or noCascade consulted) in the case of lazy properties.booleanDoes the specified cascading action require verification of no cascade validity?
-
Field Details
-
DELETE
- See Also:
-
LOCK
- See Also:
-
REFRESH
- See Also:
-
EVICT
- See Also:
-
SAVE_UPDATE
- See Also:
-
MERGE
- See Also:
-
SAVE_UPDATE_COPY
- See Also:
-
PERSIST
- See Also:
-
PERSIST_ON_FLUSH
Execute persist during flush time- See Also:
-
REPLICATE
- See Also:
-
-
Method Details
-
cascade
public abstract void cascade(EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) throws HibernateException Cascade the action to the child object.- Parameters:
session- The session within which the cascade is occuring.child- The child to which cascading should be performed.entityName- The child's entity nameanything- Anything ;) Typically some form of cascade-local cache which is specific to each CascadingAction typeisCascadeDeleteEnabled- Are cascading deletes enabled.- Throws:
HibernateException
-
getCascadableChildrenIterator
public abstract Iterator getCascadableChildrenIterator(EventSource session, CollectionType collectionType, Object collection) Given a collection, get an iterator of the children upon which the current cascading action should be visited.- Parameters:
session- The session within which the cascade is occuring.collectionType- The mapping type of the collection.collection- The collection instance.- Returns:
- The children iterator.
-
deleteOrphans
public abstract boolean deleteOrphans()Does this action potentially extrapolate to orphan deletes?- Returns:
- True if this action can lead to deletions of orphans.
-
requiresNoCascadeChecking
public boolean requiresNoCascadeChecking()Does the specified cascading action require verification of no cascade validity?- Returns:
- True if this action requires no-cascade verification; false otherwise.
-
noCascade
public void noCascade(EventSource session, Object child, Object parent, EntityPersister persister, int propertyIndex) Called (in the case ofrequiresNoCascadeChecking()returning true) to validate that no cascade on the given property is considered a valid semantic.- Parameters:
session- The session witin which the cascade is occurring.child- The property valueparent- The property value ownerpersister- The entity persister for the ownerpropertyIndex- The index of the property within the owner.
-
performOnLazyProperty
public boolean performOnLazyProperty()Should this action be performed (or noCascade consulted) in the case of lazy properties. -
getLoadedElementsIterator
public static Iterator getLoadedElementsIterator(SessionImplementor session, CollectionType collectionType, Object collection) Iterate just the elements of the collection that are already there. Don't load any new elements from the database.
-