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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkId
(Object object, EntityPersister persister, Object id, Status status, SessionImplementor session) Make sure user didn't mangle the id.protected void
dirtyCheck
(FlushEntityEvent event) Perform a dirty check, and attach the results to the eventprotected boolean
void
injectCallbackRegistry
(CallbackRegistry callbackRegistry) Injection of the CallbackRegistryprotected boolean
protected final boolean
Performs all necessary checking to determine if an entity needs an SQL update to synchronize its state to the database.void
onFlushEntity
(FlushEntityEvent event) Flushes a single entity's state to the database, by scheduling an update action, if necessary
-
Constructor Details
-
DefaultFlushEntityEventListener
public DefaultFlushEntityEventListener()
-
-
Method Details
-
injectCallbackRegistry
Description copied from interface:CallbackRegistryConsumer
Injection of the CallbackRegistry- Specified by:
injectCallbackRegistry
in interfaceCallbackRegistryConsumer
- Parameters:
callbackRegistry
- The CallbackRegistry
-
checkId
public void checkId(Object object, EntityPersister persister, Object id, Status status, SessionImplementor session) throws HibernateException Make sure user didn't mangle the id.- Throws:
HibernateException
-
onFlushEntity
Flushes a single entity's state to the database, by scheduling an update action, if necessary- Specified by:
onFlushEntity
in interfaceFlushEntityEventListener
- Throws:
HibernateException
-
handleInterception
-
invokeInterceptor
-
isUpdateNecessary
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
Perform a dirty check, and attach the results to the event- Throws:
HibernateException
-