接口 CascadingAction

  • 所有已知实现类:
    CascadingActions.BaseCascadingAction

    public interface CascadingAction
    A session action that may be cascaded from parent entity to its children
    作者:
    Gavin King, Steve Ebersole
    • 方法详细资料

      • cascade

        void cascade​(EventSource session,
                     Object child,
                     String entityName,
                     Object anything,
                     boolean isCascadeDeleteEnabled)
              throws HibernateException
        Cascade the action to the child object.
        参数:
        session - The session within which the cascade is occurring.
        child - The child to which cascading should be performed.
        entityName - The child's entity name
        anything - Anything ;) Typically some form of cascade-local cache which is specific to each CascadingAction type
        isCascadeDeleteEnabled - Are cascading deletes enabled.
        抛出:
        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.
        参数:
        session - The session within which the cascade is occurring.
        collectionType - The mapping type of the collection.
        collection - The collection instance.
        返回:
        The children iterator.
      • deleteOrphans

        boolean deleteOrphans()
        Does this action potentially extrapolate to orphan deletes?
        返回:
        True if this action can lead to deletions of orphans.
      • requiresNoCascadeChecking

        boolean requiresNoCascadeChecking()
        Does the specified cascading action require verification of no cascade validity?
        返回:
        True if this action requires no-cascade verification; false otherwise.
      • noCascade

        void noCascade​(EventSource session,
                       Object parent,
                       EntityPersister persister,
                       Type propertyType,
                       int propertyIndex)
        Called (in the case of requiresNoCascadeChecking() returning true) to validate that no cascade on the given property is considered a valid semantic.
        参数:
        session - The session within which the cascade is occurring.
        parent - The property value owner
        persister - The entity persister for the owner
        propertyType - The property type
        propertyIndex - 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.