|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hibernate.event.def.AbstractEventListener
org.hibernate.event.def.AbstractReassociateEventListener
org.hibernate.event.def.AbstractSaveEventListener
A convenience bas class for listeners responding to save events.
Field Summary | |
protected static int |
DELETED
|
protected static int |
DETACHED
|
protected static int |
PERSISTENT
|
protected static int |
TRANSIENT
|
Constructor Summary | |
AbstractSaveEventListener()
|
Method Summary | |
protected void |
cascadeAfterSave(SessionImplementor source,
EntityPersister persister,
Object entity,
Object anything)
Handles to calls needed to perform post-save cascades. |
protected void |
cascadeBeforeSave(SessionImplementor source,
EntityPersister persister,
Object entity,
Object anything)
Handles the calls needed to perform pre-save cascades for the given entity. |
protected Boolean |
getAssumedUnsaved()
|
protected abstract Cascades.CascadingAction |
getCascadeAction()
|
protected int |
getEntityState(Object entity,
String entityName,
EntityEntry entry,
SessionImplementor source)
Determine whether the entity is persistent, detached, or transient |
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,
SessionImplementor source)
Ppepares the save call by checking the session caches for a pre-existing entity and performing any lifecycle callbacks. |
protected Serializable |
performSaveOrReplicate(Object entity,
Serializable id,
EntityPersister persister,
boolean useIdentityColumn,
Object anything,
SessionImplementor source)
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,
SessionImplementor source)
Prepares the save call using a newly generated id. |
protected Serializable |
saveWithRequestedId(Object entity,
Serializable requestedId,
String entityName,
Object anything,
SessionImplementor 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 boolean |
visitCollectionsBeforeSave(Serializable id,
Object[] values,
Type[] types,
SessionImplementor source)
|
Methods inherited from class org.hibernate.event.def.AbstractReassociateEventListener |
reassociate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int PERSISTENT
protected static final int TRANSIENT
protected static final int DETACHED
protected static final int DELETED
Constructor Detail |
public AbstractSaveEventListener()
Method Detail |
protected Serializable saveWithRequestedId(Object entity, Serializable requestedId, String entityName, Object anything, SessionImplementor source) throws HibernateException
entity
- The entity to be saved.requestedId
- The id to which to associate the entity.source
- The session which is the source of this save event.
HibernateException
protected Serializable saveWithGeneratedId(Object entity, String entityName, Object anything, SessionImplementor source) throws HibernateException
entity
- The entity to be savedsource
- The session which is the source of this save event.
HibernateException
protected Serializable performSave(Object entity, Serializable id, EntityPersister persister, boolean useIdentityColumn, Object anything, SessionImplementor source) throws HibernateException
entity
- The entity to be saved.id
- The id by which to save the entity.persister
- The entity's persister instance.useIdentityColumn
- Is an identity column in use?source
- The session from which the event originated.
HibernateException
protected Serializable performSaveOrReplicate(Object entity, Serializable id, EntityPersister persister, boolean useIdentityColumn, Object anything, SessionImplementor source) throws HibernateException
entity
- The entity to be savedid
- The id to be used for saving the entity (or null, in the case of identity columns)persister
- The entity's persister instance.useIdentityColumn
- Should an identity column be used for id generation?source
- The session which is the source of the current event.
HibernateException
protected boolean isVersionIncrementDisabled()
protected boolean visitCollectionsBeforeSave(Serializable id, Object[] values, Type[] types, SessionImplementor source)
protected boolean substituteValuesIfNecessary(Object entity, Serializable id, Object[] values, EntityPersister persister, SessionImplementor source)
protected void cascadeBeforeSave(SessionImplementor source, EntityPersister persister, Object entity, Object anything) throws HibernateException
source
- The session from whcih the save event originated.persister
- The entity's persister instance.entity
- The entity to be saved.
HibernateException
protected void cascadeAfterSave(SessionImplementor source, EntityPersister persister, Object entity, Object anything) throws HibernateException
source
- The session from which the event originated.persister
- The entity's persister instance.entity
- The entity beng saved.
HibernateException
protected abstract Cascades.CascadingAction getCascadeAction()
protected int getEntityState(Object entity, String entityName, EntityEntry entry, SessionImplementor source)
protected Boolean getAssumedUnsaved()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |