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 java.lang.Object implements org.hibernate.event.spi.FlushEntityEventListener, org.hibernate.jpa.event.spi.CallbackRegistryConsumer
A reactificDefaultFlushEntityEventListener
. This implementation is almost, but not quite, a line-for-line copy ofDefaultFlushEntityEventListener
. The only difference is that it createsReactiveEntityUpdateAction
s. Unlike other event listeners in this package, this listener'sonFlushEntity(FlushEntityEvent)
method does not need to by called in a non-blocking manner, and so therefore there is noReactiveFlushEntityEventListener
interface.
-
-
Constructor Summary
Constructors Constructor Description DefaultReactiveFlushEntityEventListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkId(java.lang.Object object, org.hibernate.persister.entity.EntityPersister persister, java.lang.Object id, org.hibernate.engine.spi.SessionImplementor session)
make sure user didn't mangle the idprotected void
dirtyCheck(org.hibernate.event.spi.FlushEntityEvent event)
Perform a dirty check, and attach the results to the eventprotected boolean
handleInterception(org.hibernate.event.spi.FlushEntityEvent event)
void
injectCallbackRegistry(org.hibernate.jpa.event.spi.CallbackRegistry callbackRegistry)
protected boolean
invokeInterceptor(org.hibernate.event.spi.FlushEntityEvent event)
protected boolean
isUpdateNecessary(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.void
onFlushEntity(org.hibernate.event.spi.FlushEntityEvent event)
Flushes a single entity's state to the database, by scheduling an update action, if necessary
-
-
-
Field Detail
-
LOG
protected static final Log LOG
-
-
Method Detail
-
injectCallbackRegistry
public void injectCallbackRegistry(org.hibernate.jpa.event.spi.CallbackRegistry callbackRegistry)
- Specified by:
injectCallbackRegistry
in interfaceorg.hibernate.jpa.event.spi.CallbackRegistryConsumer
-
checkId
public void checkId(java.lang.Object object, org.hibernate.persister.entity.EntityPersister persister, java.lang.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:
onFlushEntity
in 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
-
-