org.hibernate.event.def
Class DefaultMergeEventListener

java.lang.Object
  extended by org.hibernate.event.def.AbstractReassociateEventListener
      extended by org.hibernate.event.def.AbstractSaveEventListener
          extended by org.hibernate.event.def.DefaultMergeEventListener
All Implemented Interfaces:
Serializable, MergeEventListener
Direct Known Subclasses:
DefaultSaveOrUpdateCopyEventListener

public class DefaultMergeEventListener
extends AbstractSaveEventListener
implements MergeEventListener

Defines the default copy event listener used by hibernate for copying entities in response to generated copy events.

Author:
Gavin King
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.hibernate.event.def.AbstractSaveEventListener
DELETED, DETACHED, PERSISTENT, TRANSIENT
 
Constructor Summary
DefaultMergeEventListener()
           
 
Method Summary
protected  void cascadeAfterSave(EventSource source, EntityPersister persister, Object entity, Object anything)
          Cascade behavior is redefined by this subclass, disable superclass behavior
protected  void cascadeBeforeSave(EventSource source, EntityPersister persister, Object entity, Object anything)
          Cascade behavior is redefined by this subclass, disable superclass behavior
protected  void cascadeOnMerge(EventSource source, EntityPersister persister, Object entity, Map copyCache)
          Perform any cascades needed as part of this copy event.
protected  void copyValues(EntityPersister persister, Object entity, Object target, SessionImplementor source, Map copyCache)
           
protected  void copyValues(EntityPersister persister, Object entity, Object target, SessionImplementor source, Map copyCache, ForeignKeyDirection foreignKeyDirection)
           
protected  void entityIsDetached(MergeEvent event, Map copyCache)
           
protected  void entityIsPersistent(MergeEvent event, Map copyCache)
           
protected  void entityIsTransient(MergeEvent event, Map copyCache)
           
protected  Boolean getAssumedUnsaved()
           
protected  CascadingAction getCascadeAction()
           
protected  Map getMergeMap(Object anything)
           
 void onMerge(MergeEvent event)
          Handle the given merge event.
 void onMerge(MergeEvent event, Map copyCache)
          Handle the given merge event.
 
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

DefaultMergeEventListener

public DefaultMergeEventListener()
Method Detail

getMergeMap

protected Map getMergeMap(Object anything)
Overrides:
getMergeMap in class AbstractSaveEventListener

onMerge

public void onMerge(MergeEvent event)
             throws HibernateException
Handle the given merge event.

Specified by:
onMerge in interface MergeEventListener
Parameters:
event - The merge event to be handled.
Throws:
HibernateException

onMerge

public void onMerge(MergeEvent event,
                    Map copyCache)
             throws HibernateException
Handle the given merge event.

Specified by:
onMerge in interface MergeEventListener
Parameters:
event - The merge event to be handled.
Throws:
HibernateException

entityIsPersistent

protected void entityIsPersistent(MergeEvent event,
                                  Map copyCache)

entityIsTransient

protected void entityIsTransient(MergeEvent event,
                                 Map copyCache)

entityIsDetached

protected void entityIsDetached(MergeEvent event,
                                Map copyCache)

copyValues

protected void copyValues(EntityPersister persister,
                          Object entity,
                          Object target,
                          SessionImplementor source,
                          Map copyCache)

copyValues

protected void copyValues(EntityPersister persister,
                          Object entity,
                          Object target,
                          SessionImplementor source,
                          Map copyCache,
                          ForeignKeyDirection foreignKeyDirection)

cascadeOnMerge

protected void cascadeOnMerge(EventSource source,
                              EntityPersister persister,
                              Object entity,
                              Map copyCache)
Perform any cascades needed as part of this copy event.

Parameters:
source - The merge event being processed.
persister - The persister of the entity being copied.
entity - The entity being copied.
copyCache - A cache of already copied instance.

getCascadeAction

protected CascadingAction getCascadeAction()
Specified by:
getCascadeAction in class AbstractSaveEventListener

getAssumedUnsaved

protected Boolean getAssumedUnsaved()
Overrides:
getAssumedUnsaved in class AbstractSaveEventListener

cascadeAfterSave

protected void cascadeAfterSave(EventSource source,
                                EntityPersister persister,
                                Object entity,
                                Object anything)
                         throws HibernateException
Cascade behavior is redefined by this subclass, disable superclass behavior

Overrides:
cascadeAfterSave in class AbstractSaveEventListener
Parameters:
source - The session from which the event originated.
persister - The entity's persister instance.
entity - The entity beng saved.
anything - Generally cascade-specific data
Throws:
HibernateException

cascadeBeforeSave

protected void cascadeBeforeSave(EventSource source,
                                 EntityPersister persister,
                                 Object entity,
                                 Object anything)
                          throws HibernateException
Cascade behavior is redefined by this subclass, disable superclass behavior

Overrides:
cascadeBeforeSave in class AbstractSaveEventListener
Parameters:
source - The session from whcih the save event originated.
persister - The entity's persister instance.
entity - The entity to be saved.
anything - Generally cascade-specific data
Throws:
HibernateException


Copyright © 2009 Hibernate.org. All Rights Reserved.