Package org.hibernate.event.def

Source Code of org.hibernate.event.def.DefaultFlushEventListener

//$Id: DefaultFlushEventListener.java 6929 2005-05-27 03:54:08Z oneovthafew $
package org.hibernate.event.def;

import org.hibernate.HibernateException;
import org.hibernate.event.EventSource;
import org.hibernate.event.FlushEvent;
import org.hibernate.event.FlushEventListener;

/**
* Defines the default flush event listeners used by hibernate for
* flushing session state in response to generated flush events.
*
* @author Steve Ebersole
*/
public class DefaultFlushEventListener extends AbstractFlushingEventListener implements FlushEventListener {

  /** Handle the given flush event.
   *
   * @param event The flush event to be handled.
   * @throws HibernateException
   */
  public void onFlush(FlushEvent event) throws HibernateException {
    final EventSource source = event.getSession();
    if ( source.getPersistenceContext().hasNonReadOnlyEntities() ) {
     
      flushEverythingToExecutions(event);
      performExecutions(source);
      postFlush(source);
   
      if ( source.getFactory().getStatistics().isStatisticsEnabled() ) {
        source.getFactory().getStatisticsImplementor().flush();
      }
     
    }
  }
}
TOP

Related Classes of org.hibernate.event.def.DefaultFlushEventListener

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.