Save This Page
Home » hibernate-distribution-3.3.1.GA-dist » org.hibernate » event » def » [javadoc | source]
org.hibernate.event.def
public class: DefaultDeleteEventListener [javadoc | source]
java.lang.Object
   org.hibernate.event.def.DefaultDeleteEventListener

All Implemented Interfaces:
    DeleteEventListener

Defines the default delete event listener used by hibernate for deleting entities from the datastore in response to generated delete events.
Method from org.hibernate.event.def.DefaultDeleteEventListener Summary:
cascadeAfterDelete,   cascadeBeforeDelete,   deleteEntity,   deleteTransientEntity,   invokeDeleteLifecycle,   onDelete,   onDelete,   performDetachedEntityDeletionCheck
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.event.def.DefaultDeleteEventListener Detail:
 protected  void cascadeAfterDelete(EventSource session,
    EntityPersister persister,
    Object entity,
    Set transientEntities) throws HibernateException 
 protected  void cascadeBeforeDelete(EventSource session,
    EntityPersister persister,
    Object entity,
    EntityEntry entityEntry,
    Set transientEntities) throws HibernateException 
 protected final  void deleteEntity(EventSource session,
    Object entity,
    EntityEntry entityEntry,
    boolean isCascadeDeleteEnabled,
    EntityPersister persister,
    Set transientEntities) 
    Perform the entity deletion. Well, as with most operations, does not really perform it; just schedules an action/execution with the org.hibernate.engine.ActionQueue for execution during flush.
 protected  void deleteTransientEntity(EventSource session,
    Object entity,
    boolean cascadeDeleteEnabled,
    EntityPersister persister,
    Set transientEntities) 
    We encountered a delete request on a transient instance.

    This is a deviation from historical Hibernate (pre-3.2) behavior to align with the JPA spec, which states that transient entities can be passed to remove operation in which case cascades still need to be performed.

 protected boolean invokeDeleteLifecycle(EventSource session,
    Object entity,
    EntityPersister persister) 
 public  void onDelete(DeleteEvent event) throws HibernateException 
    Handle the given delete event.
 public  void onDelete(DeleteEvent event,
    Set transientEntities) throws HibernateException 
    Handle the given delete event. This is the cascaded form.
 protected  void performDetachedEntityDeletionCheck(DeleteEvent event) 
    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.