类 IdTransferringMergeEventListener

  • 所有已实现的接口:
    Serializable, org.hibernate.event.MergeEventListener

    @Deprecated
    public class IdTransferringMergeEventListener
    extends org.hibernate.event.def.DefaultMergeEventListener
    已过时。
    as of Spring 4.3, in favor of Hibernate 4.x/5.x
    Extension of Hibernate's DefaultMergeEventListener, transferring the ids of newly saved objects to the corresponding original objects (that are part of the detached object graph passed into the merge method).

    Transferring newly assigned ids to the original graph allows for continuing to use the original object graph, despite merged copies being registered with the current Hibernate Session. This is particularly useful for web applications that might want to store an object graph and then render it in a web view, with links that include the id of certain (potentially newly saved) objects.

    The merge behavior given by this MergeEventListener is nearly identical to TopLink's merge behavior. See PetClinic for an example, which relies on ids being available for newly saved objects: the HibernateClinic and TopLinkClinic DAO implementations both use straight merge calls, with the Hibernate SessionFactory configuration specifying an IdTransferringMergeEventListener.

    Typically specified as entry for LocalSessionFactoryBean's "eventListeners" map, with key "merge".

    从以下版本开始:
    1.2
    作者:
    Juergen Hoeller
    另请参阅:
    LocalSessionFactoryBean.setEventListeners(java.util.Map), 序列化表格
    • 字段概要

      • 从类继承的字段 org.hibernate.event.def.AbstractSaveEventListener

        DELETED, DETACHED, PERSISTENT, TRANSIENT
    • 方法概要

      所有方法 实例方法 具体方法 已过时的方法 
      修饰符和类型方法说明
      protected voidentityIsTransient​(org.hibernate.event.MergeEvent event, Map copyCache)
      已过时。
      Hibernate 3.1 implementation of ID transferral.
      • 从类继承的方法 org.hibernate.event.def.DefaultMergeEventListener

        cascadeAfterSave, cascadeBeforeSave, cascadeOnMerge, copyValues, copyValues, entityIsDetached, entityIsPersistent, getAssumedUnsaved, getCascadeAction, getMergeMap, getTransientCopyCache, mergeTransientEntity, onMerge, onMerge, retryMergeTransientEntities
      • 从类继承的方法 org.hibernate.event.def.AbstractSaveEventListener

        getEntityState, getLoggableName, invokeSaveLifecycle, isVersionIncrementDisabled, performSave, performSaveOrReplicate, saveWithGeneratedId, saveWithRequestedId, substituteValuesIfNecessary, validate, visitCollectionsBeforeSave
      • 从类继承的方法 org.hibernate.event.def.AbstractReassociateEventListener

        reassociate
    • 方法详细资料

      • entityIsTransient

        protected void entityIsTransient​(org.hibernate.event.MergeEvent event,
                                         Map copyCache)
        已过时。
        Hibernate 3.1 implementation of ID transferral.
        覆盖:
        entityIsTransient 在类中 org.hibernate.event.def.DefaultMergeEventListener