1 package org.hibernate.ejb.callback; 3 4 import org.hibernate.event.def.DefaultPersistEventListener; 5 import org.hibernate.event.EventSource; 6 import org.hibernate.persister.entity.EntityPersister; 7 8 13 public class EJB3PersistEventListener extends DefaultPersistEventListener { 14 private EntityCallbackHandler callbackHandler; 15 16 public EJB3PersistEventListener(EntityCallbackHandler callbackHandler) { 17 super(); 18 this.callbackHandler = callbackHandler; 19 } 20 21 @Override protected boolean invokeSaveLifecycle(Object entity, EntityPersister persister, EventSource source) { 22 callbackHandler.preCreate( entity ); return super.invokeSaveLifecycle( entity, persister, source ); 24 } 25 } 26 | Popular Tags |