Package org.hibernate.action.internal
Class EntityUpdateAction
- java.lang.Object
-
- org.hibernate.action.internal.EntityAction
-
- org.hibernate.action.internal.EntityUpdateAction
-
- All Implemented Interfaces:
Serializable
,Comparable<ComparableExecutable>
,AfterTransactionCompletionProcess
,Executable
,ComparableExecutable
public class EntityUpdateAction extends EntityAction
The action for performing entity updates.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EntityUpdateAction(Object id, Object[] state, int[] dirtyProperties, boolean hasDirtyCollection, Object[] previousState, Object previousVersion, Object nextVersion, Object instance, Object rowId, EntityPersister persister, EventSource session)
Constructs an EntityUpdateAction
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cacheAfterUpdate(EntityDataAccess cache, Object ck, SharedSessionContractImplementor session)
void
doAfterTransactionCompletion(boolean success, SharedSessionContractImplementor session)
Perform whatever processing is encapsulated here after completion of the transaction.void
execute()
Execute this action.protected int[]
getDirtyFields()
protected NaturalIdMapping
getNaturalIdMapping()
protected Object
getNextVersion()
protected Object
getPreviousNaturalIdValues()
protected Object[]
getPreviousState()
protected Object
getPreviousVersion()
Object
getRowId()
protected Object[]
getState()
protected void
handleDeleted(EntityEntry entry)
protected void
handleNaturalIdResolutions(EntityPersister persister, SharedSessionContractImplementor session, Object id)
protected boolean
hasDirtyCollection()
protected boolean
hasPostCommitEventListeners()
protected Object
lockCacheItem(Object previousVersion)
protected void
postCommitUpdate(boolean success)
protected void
postUpdate()
protected boolean
preUpdate()
protected void
setCacheEntry(Object cacheEntry)
protected void
setLock(SoftLock lock)
protected boolean
updateCache(EntityPersister persister, Object previousVersion, Object ck)
protected void
updateCacheItem(Object previousVersion, Object ck, EntityEntry entry)
-
Methods inherited from class org.hibernate.action.internal.EntityAction
afterDeserialize, beforeExecutions, compareTo, eventSource, getAfterTransactionCompletionProcess, getBeforeTransactionCompletionProcess, getDelayedId, getEntityName, getFastSessionServices, getId, getInstance, getPersister, getPrimarySortClassifier, getPropertySpaces, getSecondarySortIndex, getSession, isVeto, needsAfterTransactionCompletion, setVeto, toString
-
-
-
-
Constructor Detail
-
EntityUpdateAction
public EntityUpdateAction(Object id, Object[] state, int[] dirtyProperties, boolean hasDirtyCollection, Object[] previousState, Object previousVersion, Object nextVersion, Object instance, Object rowId, EntityPersister persister, EventSource session)
Constructs an EntityUpdateAction- Parameters:
id
- The entity identifierstate
- The current (extracted) entity statedirtyProperties
- The indexes (in reference to state) properties with dirty statehasDirtyCollection
- Were any collections dirty?previousState
- The previous (stored) statepreviousVersion
- The previous (stored) versionnextVersion
- The incremented versioninstance
- The entity instancerowId
- The entity's row idpersister
- The entity's persistersession
- The session
-
-
Method Detail
-
getState
protected Object[] getState()
-
getPreviousState
protected Object[] getPreviousState()
-
getNextVersion
protected Object getNextVersion()
-
getDirtyFields
protected int[] getDirtyFields()
-
hasDirtyCollection
protected boolean hasDirtyCollection()
-
getNaturalIdMapping
protected NaturalIdMapping getNaturalIdMapping()
-
getPreviousNaturalIdValues
protected Object getPreviousNaturalIdValues()
-
getRowId
public Object getRowId()
-
setLock
protected void setLock(SoftLock lock)
-
setCacheEntry
protected void setCacheEntry(Object cacheEntry)
-
execute
public void execute() throws HibernateException
Description copied from interface:Executable
Execute this action.- Throws:
HibernateException
- Indicates a problem during execution.
-
handleNaturalIdResolutions
protected void handleNaturalIdResolutions(EntityPersister persister, SharedSessionContractImplementor session, Object id)
-
updateCacheItem
protected void updateCacheItem(Object previousVersion, Object ck, EntityEntry entry)
-
handleDeleted
protected void handleDeleted(EntityEntry entry)
-
getPreviousVersion
protected Object getPreviousVersion()
-
updateCache
protected boolean updateCache(EntityPersister persister, Object previousVersion, Object ck)
-
preUpdate
protected boolean preUpdate()
-
postUpdate
protected void postUpdate()
-
postCommitUpdate
protected void postCommitUpdate(boolean success)
-
hasPostCommitEventListeners
protected boolean hasPostCommitEventListeners()
- Specified by:
hasPostCommitEventListeners
in classEntityAction
-
doAfterTransactionCompletion
public void doAfterTransactionCompletion(boolean success, SharedSessionContractImplementor session) throws CacheException
Description copied from interface:AfterTransactionCompletionProcess
Perform whatever processing is encapsulated here after completion of the transaction.- Parameters:
success
- Did the transaction complete successfully? True means it did.session
- The session on which the transaction is completing.- Throws:
CacheException
-
cacheAfterUpdate
protected void cacheAfterUpdate(EntityDataAccess cache, Object ck, SharedSessionContractImplementor session)
-
-