1 //$Id: EJB3AutoFlushEventListener.java,v 1.6 2005/07/09 20:04:27 epbernard Exp $2 package org.hibernate.ejb;3 4 import org.hibernate.engine.CascadingAction;5 import org.hibernate.event.AutoFlushEventListener;6 import org.hibernate.event.def.DefaultAutoFlushEventListener;7 import org.hibernate.util.IdentityMap;8 9 /**10 * In EJB3, it is the create operation that is cascaded to unmanaged11 * ebtities at flush time (instead of the save-update operation in12 * Hibernate).13 *14 * @author Gavin King15 */16 public class EJB3AutoFlushEventListener extends DefaultAutoFlushEventListener {17 18 static final AutoFlushEventListener INSTANCE = new EJB3AutoFlushEventListener();19 20 protected CascadingAction getCascadingAction() {21 return CascadingAction.PERSIST;22 }23 24 protected Object getAnything() {25 return IdentityMap.instantiate( 10 );26 }27 28 }29