Package org.hibernate.event.internal
Class AbstractFlushingEventListener
java.lang.Object
org.hibernate.event.internal.AbstractFlushingEventListener
- Direct Known Subclasses:
DefaultAutoFlushEventListener,DefaultFlushEventListener
A convenience base class for listeners whose functionality results in flushing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCoordinates the processing necessary to get things ready for executions as db calls by preparing the session caches and moving the appropriate entities and collections to their respective execution queues.protected voidflushEverythingToExecutions(FlushEvent event, PersistenceContext persistenceContext, 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) Recreate the collection key to collection mapping rebuild the collection entries callInterceptor.postFlush(java.util.Iterator<java.lang.Object>)protected voidpostPostFlush(SessionImplementor session) protected voidpreFlush(EventSource session, PersistenceContext persistenceContext)
-
Constructor Details
-
AbstractFlushingEventListener
public AbstractFlushingEventListener()
-
-
Method Details
-
flushEverythingToExecutions
Coordinates the processing necessary to get things ready for executions as db calls by preparing 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
-
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
- Recreate the collection key to collection mapping
- rebuild the collection entries
- call
Interceptor.postFlush(java.util.Iterator<java.lang.Object>)
- Throws:
HibernateException
-
postPostFlush
-