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 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 entity
      parentEntityName - The name of the parent entity
      propertyName - The name of the attribute of the parent entity being cascaded
      attributePath - The full path of the attribute of the parent entity being cascaded
      anything - Some context specific to the kind of CascadingAction
      isCascadeDeleteEnabled - Whether the foreign key is declared with on 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

      boolean anythingToCascade(EntityPersister persister)
      Does this action have any work to do for the entity type with the given persister?
      Since:
      7
    • appliesTo

      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?
      Since:
      7
    • cascadeNow

      boolean cascadeNow(CascadePoint cascadePoint, AssociationType associationType, SessionFactoryImplementor factory)
      Does this action cascade to the given association at the given CascadePoint?
      Since:
      7
    • directionAffectedByCascadeDelete

      @Incubating @Nullable ForeignKeyDirection directionAffectedByCascadeDelete()
      The cascade direction in which we care whether the foreign key is declared with on 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.