Package org.hibernate.event.internal
Class DefaultFlushEntityEventListener
- java.lang.Object
-
- org.hibernate.event.internal.DefaultFlushEntityEventListener
-
- All Implemented Interfaces:
FlushEntityEventListener,CallbackRegistryConsumer
public class DefaultFlushEntityEventListener extends Object implements FlushEntityEventListener, CallbackRegistryConsumer
An event that occurs for each entity instance at flush time
-
-
Constructor Summary
Constructors Constructor Description DefaultFlushEntityEventListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckId(Object object, EntityPersister persister, EntityEntry entry, SessionImplementor session)make sure user didn't mangle the idprotected voiddirtyCheck(FlushEntityEvent event)Perform a dirty check, and attach the results to the eventprotected booleanhandleInterception(FlushEntityEvent event)voidinjectCallbackRegistry(CallbackRegistry callbackRegistry)Injection of the CallbackRegistryprotected booleaninvokeInterceptor(FlushEntityEvent event)protected booleanisUpdateNecessary(FlushEntityEvent event)Performs all necessary checking to determine if an entity needs an SQL update to synchronize its state to the database.voidonFlushEntity(FlushEntityEvent event)Flushes a single entity's state to the database, by scheduling an update action, if necessary
-
-
-
Method Detail
-
injectCallbackRegistry
public void injectCallbackRegistry(CallbackRegistry callbackRegistry)
Description copied from interface:CallbackRegistryConsumerInjection of the CallbackRegistry- Specified by:
injectCallbackRegistryin interfaceCallbackRegistryConsumer- Parameters:
callbackRegistry- The CallbackRegistry
-
checkId
public void checkId(Object object, EntityPersister persister, EntityEntry entry, SessionImplementor session) throws HibernateException
make sure user didn't mangle the id- Throws:
HibernateException
-
onFlushEntity
public void onFlushEntity(FlushEntityEvent event) throws HibernateException
Flushes a single entity's state to the database, by scheduling an update action, if necessary- Specified by:
onFlushEntityin interfaceFlushEntityEventListener- Throws:
HibernateException
-
handleInterception
protected boolean handleInterception(FlushEntityEvent event)
-
invokeInterceptor
protected boolean invokeInterceptor(FlushEntityEvent event)
-
isUpdateNecessary
protected final boolean isUpdateNecessary(FlushEntityEvent event) throws 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:
HibernateException
-
dirtyCheck
protected void dirtyCheck(FlushEntityEvent event) throws HibernateException
Perform a dirty check, and attach the results to the event- Throws:
HibernateException
-
-