Class MergeEventListener

  • All Implemented Interfaces:
    java.io.Serializable, org.hibernate.event.MergeEventListener

    public class MergeEventListener
    extends org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener
    responsible for responding to merge events. in particular in load/re-loading certain types to make use by clients easier. In general, enforces the detached-graph re-attachment "Commandments" as outlined in TODO. Objects that are transient (no ID) are unchanged; objects that are managed (with ID) are checked for validity (i.e. must have a version); and unloaded/filtered objects and collections are re-filled.
    Since:
    3.0
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String MERGE_EVENT  
      • Fields inherited from class org.hibernate.event.def.AbstractSaveEventListener

        DELETED, DETACHED, PERSISTENT, TRANSIENT
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void copyValues​(org.hibernate.persister.entity.EntityPersister persister, java.lang.Object entity, java.lang.Object target, org.hibernate.engine.SessionImplementor source, java.util.Map copyCache)  
      protected void copyValues​(org.hibernate.persister.entity.EntityPersister persister, java.lang.Object entity, java.lang.Object target, org.hibernate.engine.SessionImplementor source, java.util.Map copyCache, org.hibernate.type.ForeignKeyDirection foreignKeyDirection)  
      protected void entityIsDetached​(org.hibernate.event.MergeEvent event, java.util.Map copyCache)  
      protected void entityIsTransient​(org.hibernate.event.MergeEvent event, java.util.Map copyCache)  
      protected void fillReplacement​(org.hibernate.event.MergeEvent event)  
      void onMerge​(org.hibernate.event.MergeEvent event)  
      void onMerge​(org.hibernate.event.MergeEvent event, java.util.Map copyCache)  
      protected void propagateHiddenValues​(ome.model.IObject from, ome.model.IObject to)  
      • Methods inherited from class org.hibernate.event.def.DefaultMergeEventListener

        cascadeAfterSave, cascadeBeforeSave, cascadeOnMerge, entityIsPersistent, getAssumedUnsaved, getCascadeAction, getMergeMap, getTransientCopyCache, mergeTransientEntity, retryMergeTransientEntities
      • Methods inherited from class org.hibernate.event.def.AbstractSaveEventListener

        getEntityState, getLoggableName, invokeSaveLifecycle, isVersionIncrementDisabled, performSave, performSaveOrReplicate, saveWithGeneratedId, saveWithRequestedId, substituteValuesIfNecessary, validate, visitCollectionsBeforeSave
      • Methods inherited from class org.hibernate.event.def.AbstractReassociateEventListener

        reassociate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MergeEventListener

        public MergeEventListener​(CurrentDetails cd,
                                  TokenHolder th)
        main constructor. Requires a non-null security system
    • Method Detail

      • onMerge

        public void onMerge​(org.hibernate.event.MergeEvent event)
                     throws org.hibernate.HibernateException
        Specified by:
        onMerge in interface org.hibernate.event.MergeEventListener
        Overrides:
        onMerge in class org.hibernate.event.def.DefaultMergeEventListener
        Throws:
        org.hibernate.HibernateException
      • onMerge

        public void onMerge​(org.hibernate.event.MergeEvent event,
                            java.util.Map copyCache)
                     throws org.hibernate.HibernateException
        Specified by:
        onMerge in interface org.hibernate.event.MergeEventListener
        Overrides:
        onMerge in class org.hibernate.event.def.DefaultMergeEventListener
        Throws:
        org.hibernate.HibernateException
      • copyValues

        protected void copyValues​(org.hibernate.persister.entity.EntityPersister persister,
                                  java.lang.Object entity,
                                  java.lang.Object target,
                                  org.hibernate.engine.SessionImplementor source,
                                  java.util.Map copyCache)
        Overrides:
        copyValues in class org.hibernate.event.def.DefaultMergeEventListener
      • copyValues

        protected void copyValues​(org.hibernate.persister.entity.EntityPersister persister,
                                  java.lang.Object entity,
                                  java.lang.Object target,
                                  org.hibernate.engine.SessionImplementor source,
                                  java.util.Map copyCache,
                                  org.hibernate.type.ForeignKeyDirection foreignKeyDirection)
        Overrides:
        copyValues in class org.hibernate.event.def.DefaultMergeEventListener
      • entityIsTransient

        protected void entityIsTransient​(org.hibernate.event.MergeEvent event,
                                         java.util.Map copyCache)
        Overrides:
        entityIsTransient in class org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener
      • entityIsDetached

        protected void entityIsDetached​(org.hibernate.event.MergeEvent event,
                                        java.util.Map copyCache)
        Overrides:
        entityIsDetached in class org.hibernate.event.def.DefaultMergeEventListener
      • fillReplacement

        protected void fillReplacement​(org.hibernate.event.MergeEvent event)
      • propagateHiddenValues

        protected void propagateHiddenValues​(ome.model.IObject from,
                                             ome.model.IObject to)