Save This Page
Home » hibernate-core-src-20081106 » org.hibernate » event » def » [javadoc | source]
org.hibernate.event.def
abstract public class: AbstractSaveEventListener [javadoc | source]
java.lang.Object
   org.hibernate.event.def.AbstractReassociateEventListener
      org.hibernate.event.def.AbstractSaveEventListener

All Implemented Interfaces:
    Serializable

Direct Known Subclasses:
    DefaultPersistEventListener, DefaultMergeEventListener, DefaultSaveOrUpdateEventListener, EJB3SaveEventListener, DefaultReplicateEventListener, DefaultUpdateEventListener, EJB3PersistEventListener, EJB3PersistOnFlushEventListener, EJB3SaveOrUpdateEventListener, DefaultSaveEventListener, DefaultPersistOnFlushEventListener, EJB3MergeEventListener, DefaultSaveOrUpdateCopyEventListener

A convenience bas class for listeners responding to save events.
Field Summary
protected static final  int PERSISTENT     
protected static final  int TRANSIENT     
protected static final  int DETACHED     
protected static final  int DELETED     
Method from org.hibernate.event.def.AbstractSaveEventListener Summary:
cascadeAfterSave,   cascadeBeforeSave,   getAssumedUnsaved,   getCascadeAction,   getEntityState,   getLoggableName,   getMergeMap,   invokeSaveLifecycle,   isVersionIncrementDisabled,   performSave,   performSaveOrReplicate,   saveWithGeneratedId,   saveWithRequestedId,   substituteValuesIfNecessary,   validate,   visitCollectionsBeforeSave
Methods from org.hibernate.event.def.AbstractReassociateEventListener:
reassociate
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.event.def.AbstractSaveEventListener Detail:
 protected  void cascadeAfterSave(EventSource source,
    EntityPersister persister,
    Object entity,
    Object anything) 
    Handles to calls needed to perform post-save cascades.
 protected  void cascadeBeforeSave(EventSource source,
    EntityPersister persister,
    Object entity,
    Object anything) 
    Handles the calls needed to perform pre-save cascades for the given entity.
 protected Boolean getAssumedUnsaved() 
 abstract protected CascadingAction getCascadeAction()
 protected int getEntityState(Object entity,
    String entityName,
    EntityEntry entry,
    SessionImplementor source) 
    Determine whether the entity is persistent, detached, or transient
 protected String getLoggableName(String entityName,
    Object entity) 
 protected Map getMergeMap(Object anything) 
 protected boolean invokeSaveLifecycle(Object entity,
    EntityPersister persister,
    EventSource source) 
 protected boolean isVersionIncrementDisabled() 
    After the save, will te version number be incremented if the instance is modified?
 protected Serializable performSave(Object entity,
    Serializable id,
    EntityPersister persister,
    boolean useIdentityColumn,
    Object anything,
    EventSource source,
    boolean requiresImmediateIdAccess) 
    Ppepares the save call by checking the session caches for a pre-existing entity and performing any lifecycle callbacks.
 protected Serializable performSaveOrReplicate(Object entity,
    EntityKey key,
    EntityPersister persister,
    boolean useIdentityColumn,
    Object anything,
    EventSource source,
    boolean requiresImmediateIdAccess) 
    Performs all the actual work needed to save an entity (well to get the save moved to the execution queue).
 protected Serializable saveWithGeneratedId(Object entity,
    String entityName,
    Object anything,
    EventSource source,
    boolean requiresImmediateIdAccess) 
    Prepares the save call using a newly generated id.
 protected Serializable saveWithRequestedId(Object entity,
    Serializable requestedId,
    String entityName,
    Object anything,
    EventSource source) 
    Prepares the save call using the given requested id.
 protected boolean substituteValuesIfNecessary(Object entity,
    Serializable id,
    Object[] values,
    EntityPersister persister,
    SessionImplementor source) 
    Perform any property value substitution that is necessary (interceptor callback, version initialization...)
 protected  void validate(Object entity,
    EntityPersister persister,
    EventSource source) 
 protected boolean visitCollectionsBeforeSave(Object entity,
    Serializable id,
    Object[] values,
    Type[] types,
    EventSource source)