Class DefaultReactiveFlushEntityEventListener
java.lang.Object
org.hibernate.reactive.event.impl.DefaultReactiveFlushEntityEventListener
- All Implemented Interfaces:
org.hibernate.event.spi.FlushEntityEventListener,org.hibernate.jpa.event.spi.CallbackRegistryConsumer
public class DefaultReactiveFlushEntityEventListener
extends Object
implements org.hibernate.event.spi.FlushEntityEventListener, org.hibernate.jpa.event.spi.CallbackRegistryConsumer
A reactific
DefaultFlushEntityEventListener.
This implementation is almost, but not quite, a line-for-line copy of
DefaultFlushEntityEventListener. The only difference is that it creates
ReactiveEntityUpdateActions. Unlike other event listeners in this package, this
listener's onFlushEntity(FlushEntityEvent) method does not need to by
called in a non-blocking manner, and so therefore there is no
ReactiveFlushEntityEventListener interface.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckId(Object object, org.hibernate.persister.entity.EntityPersister persister, Object id, org.hibernate.engine.spi.SessionImplementor session) make sure user didn't mangle the idprotected voiddirtyCheck(org.hibernate.event.spi.FlushEntityEvent event) Perform a dirty check, and attach the results to the eventprotected booleanhandleInterception(org.hibernate.event.spi.FlushEntityEvent event) voidinjectCallbackRegistry(org.hibernate.jpa.event.spi.CallbackRegistry callbackRegistry) protected booleaninvokeInterceptor(org.hibernate.event.spi.FlushEntityEvent event) protected final booleanisUpdateNecessary(org.hibernate.event.spi.FlushEntityEvent event) Performs all necessary checking to determine if an entity needs an SQL update to synchronize its state to the database.voidonFlushEntity(org.hibernate.event.spi.FlushEntityEvent event) Flushes a single entity's state to the database, by scheduling an update action, if necessary
-
Field Details
-
LOG
-
-
Constructor Details
-
DefaultReactiveFlushEntityEventListener
public DefaultReactiveFlushEntityEventListener()
-
-
Method Details
-
injectCallbackRegistry
public void injectCallbackRegistry(org.hibernate.jpa.event.spi.CallbackRegistry callbackRegistry) - Specified by:
injectCallbackRegistryin interfaceorg.hibernate.jpa.event.spi.CallbackRegistryConsumer
-
checkId
public void checkId(Object object, org.hibernate.persister.entity.EntityPersister persister, Object id, org.hibernate.engine.spi.SessionImplementor session) throws org.hibernate.HibernateException make sure user didn't mangle the id- Throws:
org.hibernate.HibernateException
-
onFlushEntity
public void onFlushEntity(org.hibernate.event.spi.FlushEntityEvent event) throws org.hibernate.HibernateException Flushes a single entity's state to the database, by scheduling an update action, if necessary- Specified by:
onFlushEntityin interfaceorg.hibernate.event.spi.FlushEntityEventListener- Throws:
org.hibernate.HibernateException
-
handleInterception
protected boolean handleInterception(org.hibernate.event.spi.FlushEntityEvent event) -
invokeInterceptor
protected boolean invokeInterceptor(org.hibernate.event.spi.FlushEntityEvent event) -
isUpdateNecessary
protected final boolean isUpdateNecessary(org.hibernate.event.spi.FlushEntityEvent event) throws org.hibernate.HibernateException Performs all necessary checking to determine if an entity needs an SQL update to synchronize its state to the database. Modifies the event by side-effect! Note: this method is quite slow, avoid calling if possible!- Throws:
org.hibernate.HibernateException
-
dirtyCheck
protected void dirtyCheck(org.hibernate.event.spi.FlushEntityEvent event) throws org.hibernate.HibernateException Perform a dirty check, and attach the results to the event- Throws:
org.hibernate.HibernateException
-