abstract class AbstractReactiveSaveEventListener<C> extends Object
Constructor and Description |
---|
AbstractReactiveSaveEventListener() |
Modifier and Type | Method and Description |
---|---|
protected CompletionStage<Void> | cascadeAfterSave(EventSource source, EntityPersister persister, Object entity, C context) Handles to calls needed to perform post-save cascades. |
protected CompletionStage<Void> | cascadeBeforeSave(EventSource source, EntityPersister persister, Object entity, C context) Handles the calls needed to perform pre-save cascades for the given entity. |
protected abstract CascadingAction<C> | getCascadeReactiveAction() |
protected Map<?,?> | getMergeMap(Object context) |
void | injectCallbackRegistry(CallbackRegistry callbackRegistry) |
protected CompletionStage<Void> | reactivePerformSave(Object entity, Serializable id, EntityPersister persister, boolean useIdentityColumn, C context, EventSource source, boolean requiresImmediateIdAccess) Prepares the save call by checking the session caches for a pre-existing entity and performing any lifecycle callbacks. |
protected CompletionStage<Void> | reactivePerformSaveOrReplicate(Object entity, EntityKey key, EntityPersister persister, boolean useIdentityColumn, C context, 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 CompletionStage<Void> | reactiveSaveWithGeneratedId(Object entity, String entityName, C context, EventSource source, boolean requiresImmediateIdAccess) Prepares the save call using a newly generated id. |
protected CompletionStage<Void> | reactiveSaveWithRequestedId(Object entity, Serializable requestedId, String entityName, C context, EventSource source) Prepares the save call using the given requested id. |
protected boolean | substituteValuesIfNecessary(Object entity, Serializable id, Object[] values, EntityPersister persister, SessionImplementor source) Perform any property value substitution that is necessary (interceptor callback, version initialization...) |
protected boolean | visitCollectionsBeforeSave(Object entity, Serializable id, Object[] values, Type[] types, EventSource source) |
public void injectCallbackRegistry(CallbackRegistry callbackRegistry)
protected CompletionStage<Void> reactiveSaveWithRequestedId(Object entity, Serializable requestedId, String entityName, C context, 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 CompletionStage<Void> reactiveSaveWithGeneratedId(Object entity, String entityName, C context, 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 CompletionStage<Void> reactivePerformSave(Object entity, Serializable id, EntityPersister persister, boolean useIdentityColumn, C context, 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 CompletionStage<Void> reactivePerformSaveOrReplicate(Object entity, EntityKey key, EntityPersister persister, boolean useIdentityColumn, C context, 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 CompletionStage<Void> cascadeBeforeSave(EventSource source, EntityPersister persister, Object entity, C context)
source
- The session from whcih the save event originated.persister
- The entity's persister instance.entity
- The entity to be saved.context
- Generally cascade-specific dataprotected CompletionStage<Void> cascadeAfterSave(EventSource source, EntityPersister persister, Object entity, C context)
source
- The session from which the event originated.persister
- The entity's persister instance.entity
- The entity beng saved.context
- Generally cascade-specific dataprotected abstract CascadingAction<C> getCascadeReactiveAction()
protected boolean substituteValuesIfNecessary(Object entity, Serializable id, Object[] values, EntityPersister persister, SessionImplementor source)
entity
- The entityid
- The entity identifiervalues
- The snapshot entity statepersister
- The entity persistersource
- The originating sessionprotected boolean visitCollectionsBeforeSave(Object entity, Serializable id, Object[] values, Type[] types, EventSource source)