Package org.hibernate.engine.spi
Interface CascadingAction<T>
- Type Parameters:
T- The type of some context propagated with the cascading action
- All Known Implementing Classes:
CascadingActions.BaseCascadingAction
public interfaceCascadingAction<T>A session action that may be cascaded from parent entity to its children
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidcascade(EventSource session,Object child,String entityName,T anything, boolean isCascadeDeleteEnabled)Cascade the action to the child object.booleandeleteOrphans()Does this action potentially extrapolate to orphan deletes?default @NullableForeignKeyDirectiondirectionAffectedByCascadeDelete()The cascade direction in which we care whether the foreign key is declared withon delete cascade.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.default voidnoCascade(EventSource session,Object parent,EntityPersister persister,Type propertyType, int propertyIndex)Deprecated, for removal: This API element is subject to removal in a future version.No longer usedbooleanperformOnLazyProperty()Should this action be performed (or noCascade consulted) in the case of lazy properties.default booleanrequiresNoCascadeChecking()Deprecated, for removal: This API element is subject to removal in a future version.No longer used
Method Detail
cascade
void cascade(EventSource session,Object child,String entityName,T anything, boolean isCascadeDeleteEnabled) throwsHibernateException
Cascade the action to the child object.- Parameters:
session- The session within which the cascade is occurring.child- The child to which cascading should be performed.anything- Some context specific to the kind ofCascadingActionisCascadeDeleteEnabled- Whether the foreign key is declared withon delete cascade.- Throws:
HibernateException
getCascadableChildrenIterator
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 occurring.collectionType- The mapping type of the collection.collection- The collection instance.- Returns:
- The children iterator.
deleteOrphans
boolean deleteOrphans()
Does this action potentially extrapolate to orphan deletes?- Returns:
- True if this action can lead to deletions of orphans.
requiresNoCascadeChecking
@Deprecated(since="6.6",forRemoval=true)default boolean requiresNoCascadeChecking()
Deprecated, for removal: This API element is subject to removal in a future version.No longer usedDoes the specified cascading action require verification of no cascade validity?- Returns:
- True if this action requires no-cascade verification; false otherwise.
noCascade
@Deprecated(since="6.6",forRemoval=true)default void noCascade(EventSource session,Object parent,EntityPersister persister,Type propertyType, int propertyIndex)
Deprecated, for removal: This API element is subject to removal in a future version.No longer usedCalled (in the case ofrequiresNoCascadeChecking()returning true) to validate that no cascade on the given property is considered a valid semantic.- Parameters:
session- The session within which the cascade is occurring.parent- The property value ownerpersister- The entity persister for the ownerpropertyType- The property typepropertyIndex- The index of the property within the owner.
performOnLazyProperty
boolean performOnLazyProperty()
Should this action be performed (or noCascade consulted) in the case of lazy properties.
directionAffectedByCascadeDelete
@Incubatingdefault @NullableForeignKeyDirection directionAffectedByCascadeDelete()
The cascade direction in which we care whether the foreign key is declared withon delete cascade.- API Note:
- This allows us to reuse the long-existing boolean parameter of
cascade(EventSource, Object, String, Object, boolean)for multiple purposes.