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