Class AbstractFlushingEventListener

java.lang.Object
org.hibernate.event.internal.AbstractFlushingEventListener
Direct Known Subclasses:
DefaultAutoFlushEventListener, DefaultDirtyCheckEventListener, DefaultFlushEventListener

public abstract class AbstractFlushingEventListener extends Object
A convenience base class for listeners whose functionality results in flushing.
  • Constructor Details

    • AbstractFlushingEventListener

      public AbstractFlushingEventListener()
  • Method Details

    • flushEverythingToExecutions

      protected void flushEverythingToExecutions(FlushEvent event) throws HibernateException
      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

      protected void preFlush(EventSource session, PersistenceContext persistenceContext)
    • logFlushResults

      protected void logFlushResults(FlushEvent event)
    • getContext

      protected PersistContext getContext(EventSource session)
    • getCascadingAction

      protected CascadingAction<PersistContext> getCascadingAction(EventSource session)
    • performExecutions

      protected void performExecutions(EventSource session)
      Execute all SQL (and second-level cache updates) in a special order so that foreign-key constraints cannot be violated:
      1. Inserts, in the order they were performed
      2. Updates
      3. Deletion of collection elements
      4. Insertion of collection elements
      5. Deletes, in the order they were performed
      Parameters:
      session - The session being flushed
    • postFlush

      protected void postFlush(SessionImplementor session) throws HibernateException
      1. Recreate the collection key -> collection map 2. rebuild the collection entries 3. call Interceptor.postFlush()
      Throws:
      HibernateException
    • postPostFlush

      protected void postPostFlush(SessionImplementor session)