Package org.hibernate.event.internal
Class AbstractFlushingEventListener
java.lang.Object
org.hibernate.event.internal.AbstractFlushingEventListener
- All Implemented Interfaces:
JpaBootstrapSensitive
- Direct Known Subclasses:
DefaultAutoFlushEventListener,DefaultDirtyCheckEventListener,DefaultFlushEventListener
A convenience base class for listeners whose functionality results in flushing.
- Author:
- Steve Ebersole
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCoordinates the processing necessary to get things ready for executions as db calls by preping the session caches and moving the appropriate entities and collections to their respective execution queues.protected voidflushEverythingToExecutions(FlushEvent event, PersistenceContext persistenceContext, EventSource session) protected CascadingAction<PersistContext>getCascadingAction(EventSource session) protected PersistContextgetContext(EventSource session) protected voidlogFlushResults(FlushEvent event) protected voidperformExecutions(EventSource session) Execute all SQL (and second-level cache updates) in a special order so that foreign-key constraints cannot be violated: Inserts, in the order they were performed Updates Deletion of collection elements Insertion of collection elements Deletes, in the order they were performedprotected voidpostFlush(SessionImplementor session) 1.protected voidpostPostFlush(SessionImplementor session) protected voidpreFlush(EventSource session, PersistenceContext persistenceContext) voidwasJpaBootstrap(boolean wasJpaBootstrap)
-
Constructor Details
-
AbstractFlushingEventListener
public AbstractFlushingEventListener()
-
-
Method Details
-
wasJpaBootstrap
public void wasJpaBootstrap(boolean wasJpaBootstrap) - Specified by:
wasJpaBootstrapin interfaceJpaBootstrapSensitive
-
flushEverythingToExecutions
Coordinates the processing necessary to get things ready for executions as db calls by preping the session caches and moving the appropriate entities and collections to their respective execution queues.- Parameters:
event- The flush event.- Throws:
HibernateException- Error flushing caches to execution queues.
-
flushEverythingToExecutions
protected void flushEverythingToExecutions(FlushEvent event, PersistenceContext persistenceContext, EventSource session) -
preFlush
-
logFlushResults
-
getContext
-
getCascadingAction
-
performExecutions
Execute all SQL (and second-level cache updates) in a special order so that foreign-key constraints cannot be violated:- Inserts, in the order they were performed
- Updates
- Deletion of collection elements
- Insertion of collection elements
- Deletes, in the order they were performed
- Parameters:
session- The session being flushed
-
postFlush
1. Recreate the collection key -> collection map 2. rebuild the collection entries 3. call Interceptor.postFlush()- Throws:
HibernateException
-
postPostFlush
-