Package org.hibernate.event.internal
Class DefaultMergeEventListener
- java.lang.Object
-
- org.hibernate.event.internal.AbstractReassociateEventListener
-
- org.hibernate.event.internal.AbstractSaveEventListener<MergeContext>
-
- org.hibernate.event.internal.DefaultMergeEventListener
-
- All Implemented Interfaces:
MergeEventListener
,CallbackRegistryConsumer
public class DefaultMergeEventListener extends AbstractSaveEventListener<MergeContext> implements MergeEventListener
Defines the default copy event listener used by hibernate for copying entities in response to generated copy events.
-
-
Constructor Summary
Constructors Constructor Description DefaultMergeEventListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cascadeAfterSave(EventSource source, EntityPersister persister, Object entity, MergeContext anything)
Cascade behavior is redefined by this subclass, disable superclass behaviorprotected void
cascadeBeforeSave(EventSource source, EntityPersister persister, Object entity, MergeContext anything)
Cascade behavior is redefined by this subclass, disable superclass behaviorprotected void
cascadeOnMerge(EventSource source, EntityPersister persister, Object entity, MergeContext copyCache)
Perform any cascades needed as part of this copy event.protected void
copyValues(EntityPersister persister, Object entity, Object target, SessionImplementor source, MergeContext copyCache)
protected void
copyValues(EntityPersister persister, Object entity, Object target, SessionImplementor source, MergeContext copyCache, ForeignKeyDirection foreignKeyDirection)
protected void
entityIsDetached(MergeEvent event, Object copiedId, Object originalId, MergeContext copyCache)
protected void
entityIsPersistent(MergeEvent event, MergeContext copyCache)
protected void
entityIsTransient(MergeEvent event, Object id, MergeContext copyCache)
protected CascadingAction<MergeContext>
getCascadeAction()
protected Map<Object,Object>
getMergeMap(MergeContext context)
void
onMerge(MergeEvent event)
Handle the given merge event.void
onMerge(MergeEvent event, MergeContext copiedAlready)
Handle the given merge event.-
Methods inherited from class org.hibernate.event.internal.AbstractSaveEventListener
injectCallbackRegistry, invokeSaveLifecycle, isVersionIncrementDisabled, performSave, performSaveOrReplicate, saveWithGeneratedId, saveWithRequestedId, substituteValuesIfNecessary, visitCollectionsBeforeSave
-
Methods inherited from class org.hibernate.event.internal.AbstractReassociateEventListener
reassociate
-
-
-
-
Method Detail
-
getMergeMap
protected Map<Object,Object> getMergeMap(MergeContext context)
- Overrides:
getMergeMap
in classAbstractSaveEventListener<MergeContext>
-
onMerge
public void onMerge(MergeEvent event) throws HibernateException
Handle the given merge event.- Specified by:
onMerge
in interfaceMergeEventListener
- Parameters:
event
- The merge event to be handled.- Throws:
HibernateException
-
onMerge
public void onMerge(MergeEvent event, MergeContext copiedAlready) throws HibernateException
Handle the given merge event.- Specified by:
onMerge
in interfaceMergeEventListener
- Parameters:
event
- The merge event to be handled.- Throws:
HibernateException
-
entityIsPersistent
protected void entityIsPersistent(MergeEvent event, MergeContext copyCache)
-
entityIsTransient
protected void entityIsTransient(MergeEvent event, Object id, MergeContext copyCache)
-
entityIsDetached
protected void entityIsDetached(MergeEvent event, Object copiedId, Object originalId, MergeContext copyCache)
-
copyValues
protected void copyValues(EntityPersister persister, Object entity, Object target, SessionImplementor source, MergeContext copyCache)
-
copyValues
protected void copyValues(EntityPersister persister, Object entity, Object target, SessionImplementor source, MergeContext copyCache, ForeignKeyDirection foreignKeyDirection)
-
cascadeOnMerge
protected void cascadeOnMerge(EventSource source, EntityPersister persister, Object entity, MergeContext 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<MergeContext> getCascadeAction()
- Specified by:
getCascadeAction
in classAbstractSaveEventListener<MergeContext>
-
cascadeAfterSave
protected void cascadeAfterSave(EventSource source, EntityPersister persister, Object entity, MergeContext anything) throws HibernateException
Cascade behavior is redefined by this subclass, disable superclass behavior- Overrides:
cascadeAfterSave
in classAbstractSaveEventListener<MergeContext>
- Parameters:
source
- The session from which the event originated.persister
- The entity's persister instance.entity
- The entity being saved.anything
- Generally cascade-specific data- Throws:
HibernateException
-
cascadeBeforeSave
protected void cascadeBeforeSave(EventSource source, EntityPersister persister, Object entity, MergeContext anything) throws HibernateException
Cascade behavior is redefined by this subclass, disable superclass behavior- Overrides:
cascadeBeforeSave
in classAbstractSaveEventListener<MergeContext>
- Parameters:
source
- The session from which the save event originated.persister
- The entity's persister instance.entity
- The entity to be saved.anything
- Generally cascade-specific data- Throws:
HibernateException
-
-