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 interface CascadingAction<T>
A session action that may be cascaded from parent entity to its children
-
Method Summary
Modifier and TypeMethodDescriptionboolean
anythingToCascade
(EntityPersister persister) Does this action have any work to do for the entity type with the given persister?boolean
appliesTo
(Type type, CascadeStyle style) Does this action have any work to do for fields of the given type with the given cascade style?void
cascade
(EventSource session, Object child, String childEntityName, String parentEntityName, String propertyName, @Nullable List<String> attributePath, T anything, boolean isCascadeDeleteEnabled) Cascade the action to the child object.default void
cascade
(EventSource session, Object child, String childEntityName, T anything, boolean isCascadeDeleteEnabled) Deprecated, for removal: This API element is subject to removal in a future version.No longer called.boolean
cascadeNow
(CascadePoint cascadePoint, AssociationType associationType, SessionFactoryImplementor factory) Does this action cascade to the given association at the givenCascadePoint
?boolean
Does this action potentially extrapolate to orphan deletes?@Nullable ForeignKeyDirection
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.boolean
Should this action be performed (or noCascade consulted) in the case of lazy properties.
-
Method Details
-
cascade
void cascade(EventSource session, Object child, String childEntityName, String parentEntityName, String propertyName, @Nullable List<String> attributePath, T anything, boolean isCascadeDeleteEnabled) 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.childEntityName
- The name of the child entityparentEntityName
- The name of the parent entitypropertyName
- The name of the attribute of the parent entity being cascadedattributePath
- The full path of the attribute of the parent entity being cascadedanything
- Some context specific to the kind ofCascadingAction
isCascadeDeleteEnabled
- Whether the foreign key is declared withon delete cascade
.
-
cascade
@Deprecated(since="7", forRemoval=true) default void cascade(EventSource session, Object child, String childEntityName, T anything, boolean isCascadeDeleteEnabled) Deprecated, for removal: This API element is subject to removal in a future version.No longer called. Will be removed. -
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.
-
performOnLazyProperty
boolean performOnLazyProperty()Should this action be performed (or noCascade consulted) in the case of lazy properties. -
anythingToCascade
Does this action have any work to do for the entity type with the given persister?- Since:
- 7
-
appliesTo
Does this action have any work to do for fields of the given type with the given cascade style?- Since:
- 7
-
cascadeNow
boolean cascadeNow(CascadePoint cascadePoint, AssociationType associationType, SessionFactoryImplementor factory) Does this action cascade to the given association at the givenCascadePoint
?- Since:
- 7
-
directionAffectedByCascadeDelete
The cascade direction in which we care whether the foreign key is declared withon delete cascade
.- Since:
- 7
- API Note:
- This allows us to reuse the long-existing boolean parameter of
cascade(EventSource,Object,String,String,String,List,Object,boolean)
for multiple purposes.
-