## org.hibernate.event.internal
Class DefaultMergeEventListener

    java.lang.Object
      org.hibernate.event.internal.AbstractReassociateEventListener
          org.hibernate.event.internal.AbstractSaveEventListener
              org.hibernate.event.internal.DefaultMergeEventListener

All Implemented Interfaces:
  Serializable, MergeEventListener

Direct Known Subclasses:
  EJB3MergeEventListener

    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.

See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class org.hibernate.event.internal.AbstractSaveEventListener
`AbstractSaveEventListener.EntityState`

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 copiedAlready)` Handle the given merge event.

Methods inherited from class org.hibernate.event.internal.AbstractSaveEventListener
`getEntityState, getLoggableName, invokeSaveLifecycle, isVersionIncrementDisabled, performSave, performSaveOrReplicate, saveWithGeneratedId, saveWithRequestedId, substituteValuesIfNecessary, visitCollectionsBeforeSave`

Methods inherited from class org.hibernate.event.internal.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 copiedAlready)
                 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 © 2001-2012 Red Hat, Inc. All Rights Reserved.