public class DefaultReactiveMergeEventListener extends java.lang.Object implements ReactiveMergeEventListener, org.hibernate.event.spi.MergeEventListener
DefaultMergeEventListener
.Constructor and Description |
---|
DefaultReactiveMergeEventListener() |
Modifier and Type | Method and Description |
---|---|
protected java.util.concurrent.CompletionStage<java.lang.Void> |
cascadeAfterSave(org.hibernate.event.spi.EventSource source,
org.hibernate.persister.entity.EntityPersister persister,
java.lang.Object entity,
org.hibernate.event.internal.MergeContext anything)
Cascade behavior is redefined by this subclass, disable superclass behavior
|
protected java.util.concurrent.CompletionStage<java.lang.Void> |
cascadeBeforeSave(org.hibernate.event.spi.EventSource source,
org.hibernate.persister.entity.EntityPersister persister,
java.lang.Object entity,
org.hibernate.event.internal.MergeContext anything)
Cascade behavior is redefined by this subclass, disable superclass behavior
|
protected java.util.concurrent.CompletionStage<java.lang.Void> |
cascadeOnMerge(org.hibernate.event.spi.EventSource source,
org.hibernate.persister.entity.EntityPersister persister,
java.lang.Object entity,
org.hibernate.event.internal.MergeContext copyCache)
Perform any cascades needed as part of this copy event.
|
protected void |
copyValues(org.hibernate.persister.entity.EntityPersister persister,
java.lang.Object entity,
java.lang.Object target,
org.hibernate.engine.spi.SessionImplementor source,
org.hibernate.event.internal.MergeContext copyCache) |
protected void |
copyValues(org.hibernate.persister.entity.EntityPersister persister,
java.lang.Object entity,
java.lang.Object target,
org.hibernate.engine.spi.SessionImplementor source,
org.hibernate.event.internal.MergeContext copyCache,
org.hibernate.type.ForeignKeyDirection foreignKeyDirection) |
protected java.util.concurrent.CompletionStage<java.lang.Void> |
entityIsDetached(org.hibernate.event.spi.MergeEvent event,
org.hibernate.event.internal.MergeContext copyCache) |
protected java.util.concurrent.CompletionStage<java.lang.Void> |
entityIsPersistent(org.hibernate.event.spi.MergeEvent event,
org.hibernate.event.internal.MergeContext copyCache) |
protected java.util.concurrent.CompletionStage<java.lang.Void> |
entityIsTransient(org.hibernate.event.spi.MergeEvent event,
org.hibernate.event.internal.MergeContext copyCache) |
protected CascadingAction<org.hibernate.event.internal.MergeContext> |
getCascadeReactiveAction() |
protected java.util.Map<?,?> |
getMergeMap(java.lang.Object anything) |
void |
injectCallbackRegistry(org.hibernate.jpa.event.spi.CallbackRegistry callbackRegistry) |
void |
onMerge(org.hibernate.event.spi.MergeEvent event) |
void |
onMerge(org.hibernate.event.spi.MergeEvent event,
java.util.Map copiedAlready) |
java.util.concurrent.CompletionStage<java.lang.Void> |
reactiveOnMerge(org.hibernate.event.spi.MergeEvent event)
Handle the given merge event.
|
java.util.concurrent.CompletionStage<java.lang.Void> |
reactiveOnMerge(org.hibernate.event.spi.MergeEvent event,
org.hibernate.event.internal.MergeContext copyCache)
Handle the given merge event.
|
protected java.util.concurrent.CompletionStage<java.lang.Void> |
reactivePerformSave(java.lang.Object entity,
java.io.Serializable id,
org.hibernate.persister.entity.EntityPersister persister,
boolean useIdentityColumn,
C context,
org.hibernate.event.spi.EventSource source,
boolean requiresImmediateIdAccess)
Prepares the save call by checking the session caches for a pre-existing
entity and performing any lifecycle callbacks.
|
protected java.util.concurrent.CompletionStage<java.lang.Void> |
reactivePerformSaveOrReplicate(java.lang.Object entity,
org.hibernate.engine.spi.EntityKey key,
org.hibernate.persister.entity.EntityPersister persister,
boolean useIdentityColumn,
C context,
org.hibernate.event.spi.EventSource source,
boolean requiresImmediateIdAccess)
Performs all the actual work needed to save an entity (well to get the save moved to
the execution queue).
|
protected java.util.concurrent.CompletionStage<java.lang.Void> |
reactiveSaveWithGeneratedId(java.lang.Object entity,
java.lang.String entityName,
C context,
org.hibernate.event.spi.EventSource source,
boolean requiresImmediateIdAccess)
Prepares the save call using a newly generated id.
|
protected java.util.concurrent.CompletionStage<java.lang.Void> |
reactiveSaveWithRequestedId(java.lang.Object entity,
java.io.Serializable requestedId,
java.lang.String entityName,
C context,
org.hibernate.event.spi.EventSource source)
Prepares the save call using the given requested id.
|
protected boolean |
substituteValuesIfNecessary(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] values,
org.hibernate.persister.entity.EntityPersister persister,
org.hibernate.engine.spi.SessionImplementor source)
Perform any property value substitution that is necessary
(interceptor callback, version initialization...)
|
protected boolean |
visitCollectionsBeforeSave(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] values,
org.hibernate.type.Type[] types,
org.hibernate.event.spi.EventSource source) |
public void onMerge(org.hibernate.event.spi.MergeEvent event) throws org.hibernate.HibernateException
onMerge
in interface org.hibernate.event.spi.MergeEventListener
org.hibernate.HibernateException
public void onMerge(org.hibernate.event.spi.MergeEvent event, java.util.Map copiedAlready) throws org.hibernate.HibernateException
onMerge
in interface org.hibernate.event.spi.MergeEventListener
org.hibernate.HibernateException
protected java.util.Map<?,?> getMergeMap(java.lang.Object anything)
public java.util.concurrent.CompletionStage<java.lang.Void> reactiveOnMerge(org.hibernate.event.spi.MergeEvent event) throws org.hibernate.HibernateException
reactiveOnMerge
in interface ReactiveMergeEventListener
event
- The merge event to be handled.org.hibernate.HibernateException
public java.util.concurrent.CompletionStage<java.lang.Void> reactiveOnMerge(org.hibernate.event.spi.MergeEvent event, org.hibernate.event.internal.MergeContext copyCache) throws org.hibernate.HibernateException
reactiveOnMerge
in interface ReactiveMergeEventListener
event
- The merge event to be handled.org.hibernate.HibernateException
protected java.util.concurrent.CompletionStage<java.lang.Void> entityIsPersistent(org.hibernate.event.spi.MergeEvent event, org.hibernate.event.internal.MergeContext copyCache)
protected java.util.concurrent.CompletionStage<java.lang.Void> entityIsTransient(org.hibernate.event.spi.MergeEvent event, org.hibernate.event.internal.MergeContext copyCache)
protected java.util.concurrent.CompletionStage<java.lang.Void> entityIsDetached(org.hibernate.event.spi.MergeEvent event, org.hibernate.event.internal.MergeContext copyCache)
protected void copyValues(org.hibernate.persister.entity.EntityPersister persister, java.lang.Object entity, java.lang.Object target, org.hibernate.engine.spi.SessionImplementor source, org.hibernate.event.internal.MergeContext copyCache)
protected void copyValues(org.hibernate.persister.entity.EntityPersister persister, java.lang.Object entity, java.lang.Object target, org.hibernate.engine.spi.SessionImplementor source, org.hibernate.event.internal.MergeContext copyCache, org.hibernate.type.ForeignKeyDirection foreignKeyDirection)
protected java.util.concurrent.CompletionStage<java.lang.Void> cascadeOnMerge(org.hibernate.event.spi.EventSource source, org.hibernate.persister.entity.EntityPersister persister, java.lang.Object entity, org.hibernate.event.internal.MergeContext copyCache)
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.protected CascadingAction<org.hibernate.event.internal.MergeContext> getCascadeReactiveAction()
protected java.util.concurrent.CompletionStage<java.lang.Void> cascadeAfterSave(org.hibernate.event.spi.EventSource source, org.hibernate.persister.entity.EntityPersister persister, java.lang.Object entity, org.hibernate.event.internal.MergeContext anything) throws org.hibernate.HibernateException
source
- The session from which the event originated.persister
- The entity's persister instance.entity
- The entity beng saved.anything
- Generally cascade-specific dataorg.hibernate.HibernateException
protected java.util.concurrent.CompletionStage<java.lang.Void> cascadeBeforeSave(org.hibernate.event.spi.EventSource source, org.hibernate.persister.entity.EntityPersister persister, java.lang.Object entity, org.hibernate.event.internal.MergeContext anything) throws org.hibernate.HibernateException
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 dataorg.hibernate.HibernateException
public void injectCallbackRegistry(org.hibernate.jpa.event.spi.CallbackRegistry callbackRegistry)
injectCallbackRegistry
in interface org.hibernate.jpa.event.spi.CallbackRegistryConsumer
protected java.util.concurrent.CompletionStage<java.lang.Void> reactiveSaveWithRequestedId(java.lang.Object entity, java.io.Serializable requestedId, java.lang.String entityName, C context, org.hibernate.event.spi.EventSource source)
entity
- The entity to be saved.requestedId
- The id to which to associate the entity.entityName
- The name of the entity being saved.context
- Generally cascade-specific information.source
- The session which is the source of this save event.protected java.util.concurrent.CompletionStage<java.lang.Void> reactiveSaveWithGeneratedId(java.lang.Object entity, java.lang.String entityName, C context, org.hibernate.event.spi.EventSource source, boolean requiresImmediateIdAccess)
entity
- The entity to be savedentityName
- The entity-name for the entity to be savedcontext
- Generally cascade-specific information.source
- The session which is the source of this save event.requiresImmediateIdAccess
- does the event context require
access to the identifier immediately after execution of this method (if
not, post-insert style id generators may be postponed if we are outside
a transaction).protected java.util.concurrent.CompletionStage<java.lang.Void> reactivePerformSave(java.lang.Object entity, java.io.Serializable id, org.hibernate.persister.entity.EntityPersister persister, boolean useIdentityColumn, C context, org.hibernate.event.spi.EventSource source, boolean requiresImmediateIdAccess)
entity
- The entity to be saved.id
- The id by which to save the entity.persister
- The entity's persister instance.useIdentityColumn
- Is an identity column being used?context
- Generally cascade-specific information.source
- The session from which the event originated.requiresImmediateIdAccess
- does the event context require
access to the identifier immediately after execution of this method (if
not, post-insert style id generators may be postponed if we are outside
a transaction).protected java.util.concurrent.CompletionStage<java.lang.Void> reactivePerformSaveOrReplicate(java.lang.Object entity, org.hibernate.engine.spi.EntityKey key, org.hibernate.persister.entity.EntityPersister persister, boolean useIdentityColumn, C context, org.hibernate.event.spi.EventSource source, boolean requiresImmediateIdAccess)
entity
- The entity to be savedkey
- The id to be used for saving the entity (or null, in the case of identity columns)persister
- The entity's persister instance.useIdentityColumn
- Should an identity column be used for id generation?context
- Generally cascade-specific information.source
- The session which is the source of the current event.requiresImmediateIdAccess
- Is access to the identifier required immediately
after the completion of the save? persist(), for example, does not require this...protected boolean substituteValuesIfNecessary(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] values, org.hibernate.persister.entity.EntityPersister persister, org.hibernate.engine.spi.SessionImplementor source)
entity
- The entityid
- The entity identifiervalues
- The snapshot entity statepersister
- The entity persistersource
- The originating sessionprotected boolean visitCollectionsBeforeSave(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] values, org.hibernate.type.Type[] types, org.hibernate.event.spi.EventSource source)