org.hibernate.event.def
Class DefaultUpdateEventListener

java.lang.Object
  extended by org.hibernate.event.def.AbstractReassociateEventListener
      extended by org.hibernate.event.def.AbstractSaveEventListener
          extended by org.hibernate.event.def.DefaultSaveOrUpdateEventListener
              extended by org.hibernate.event.def.DefaultUpdateEventListener
All Implemented Interfaces:
Serializable, SaveOrUpdateEventListener

public class DefaultUpdateEventListener
extends DefaultSaveOrUpdateEventListener

An event handler for update() events

Author:
Gavin King
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.hibernate.event.def.AbstractSaveEventListener
DELETED, DETACHED, PERSISTENT, TRANSIENT
 
Constructor Summary
DefaultUpdateEventListener()
           
 
Method Summary
protected  Serializable getUpdateId(Object entity, EntityPersister persister, Serializable requestedId, EntityMode entityMode)
          If the user specified an id, assign it to the instance and use that, otherwise use the id already assigned to the instance
protected  Serializable performSaveOrUpdate(SaveOrUpdateEvent event)
           
 
Methods inherited from class org.hibernate.event.def.DefaultSaveOrUpdateEventListener
entityIsDetached, entityIsPersistent, entityIsTransient, getCascadeAction, invokeUpdateLifecycle, onSaveOrUpdate, performUpdate, reassociateIfUninitializedProxy, saveWithGeneratedOrRequestedId
 
Methods inherited from class org.hibernate.event.def.AbstractSaveEventListener
cascadeAfterSave, cascadeBeforeSave, getAssumedUnsaved, getEntityState, getLoggableName, getMergeMap, invokeSaveLifecycle, isVersionIncrementDisabled, performSave, performSaveOrReplicate, saveWithGeneratedId, saveWithRequestedId, substituteValuesIfNecessary, validate, visitCollectionsBeforeSave
 
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
 

Constructor Detail

DefaultUpdateEventListener

public DefaultUpdateEventListener()
Method Detail

performSaveOrUpdate

protected Serializable performSaveOrUpdate(SaveOrUpdateEvent event)
Overrides:
performSaveOrUpdate in class DefaultSaveOrUpdateEventListener

getUpdateId

protected Serializable getUpdateId(Object entity,
                                   EntityPersister persister,
                                   Serializable requestedId,
                                   EntityMode entityMode)
                            throws HibernateException
If the user specified an id, assign it to the instance and use that, otherwise use the id already assigned to the instance

Overrides:
getUpdateId in class DefaultSaveOrUpdateEventListener
Parameters:
entity - The entity.
persister - The entity persister
requestedId - The requested identifier
entityMode - The entity mode.
Returns:
The id.
Throws:
TransientObjectException - If the entity is considered transient.
HibernateException


Copyright © null-null Red Hat Middleware, LLC. All Rights Reserved