org.hibernate.ejb.event
Class EJB3DeleteEventListener

java.lang.Object
  extended by org.hibernate.event.def.DefaultDeleteEventListener
      extended by org.hibernate.ejb.event.EJB3DeleteEventListener
All Implemented Interfaces:
Serializable, CallbackHandlerConsumer, DeleteEventListener

public class EJB3DeleteEventListener
extends DefaultDeleteEventListener
implements CallbackHandlerConsumer

Overrides the LifeCycle OnSave call to call the PreRemove operation

Author:
Emmanuel Bernard
See Also:
Serialized Form

Constructor Summary
EJB3DeleteEventListener()
           
EJB3DeleteEventListener(EntityCallbackHandler callbackHandler)
           
 
Method Summary
protected  boolean invokeDeleteLifecycle(EventSource session, Object entity, EntityPersister persister)
           
protected  void performDetachedEntityDeletionCheck(DeleteEvent event)
          Called when we have recognized an attempt to delete a detached entity.
 void setCallbackHandler(EntityCallbackHandler callbackHandler)
           
 
Methods inherited from class org.hibernate.event.def.DefaultDeleteEventListener
cascadeAfterDelete, cascadeBeforeDelete, deleteEntity, deleteTransientEntity, onDelete, onDelete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EJB3DeleteEventListener

public EJB3DeleteEventListener()

EJB3DeleteEventListener

public EJB3DeleteEventListener(EntityCallbackHandler callbackHandler)
Method Detail

setCallbackHandler

public void setCallbackHandler(EntityCallbackHandler callbackHandler)
Specified by:
setCallbackHandler in interface CallbackHandlerConsumer

invokeDeleteLifecycle

protected boolean invokeDeleteLifecycle(EventSource session,
                                        Object entity,
                                        EntityPersister persister)
Overrides:
invokeDeleteLifecycle in class DefaultDeleteEventListener

performDetachedEntityDeletionCheck

protected void performDetachedEntityDeletionCheck(DeleteEvent event)
Description copied from class: DefaultDeleteEventListener
Called when we have recognized an attempt to delete a detached entity.

This is perfectly valid in Hibernate usage; JPA, however, forbids this. Thus, this is a hook for HEM to affect this behavior.

Overrides:
performDetachedEntityDeletionCheck in class DefaultDeleteEventListener
Parameters:
event - The event.


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.