Class UpdateCoordinatorStandard
- java.lang.Object
-
- org.hibernate.persister.entity.mutation.AbstractMutationCoordinator
-
- org.hibernate.persister.entity.mutation.UpdateCoordinatorStandard
-
- All Implemented Interfaces:
MutationCoordinator
,UpdateCoordinator
- Direct Known Subclasses:
MergeCoordinator
public class UpdateCoordinatorStandard extends AbstractMutationCoordinator implements UpdateCoordinator
Coordinates the updating of an entity.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
UpdateCoordinatorStandard.DirtinessChecker
protected static interface
UpdateCoordinatorStandard.InclusionChecker
protected class
UpdateCoordinatorStandard.UpdateValuesAnalysisImpl
Contains the aggregated analysis of the update values to determine what SQL UPDATE statement(s) should be used to update the entity and to drive parameter binding
-
Field Summary
-
Fields inherited from class org.hibernate.persister.entity.mutation.AbstractMutationCoordinator
dialect, entityPersister, factory, mutationExecutorService
-
-
Constructor Summary
Constructors Modifier Constructor Description UpdateCoordinatorStandard(AbstractEntityPersister entityPersister, SessionFactoryImplementor factory)
protected
UpdateCoordinatorStandard(AbstractEntityPersister entityPersister, SessionFactoryImplementor factory, MutationOperationGroup staticUpdateGroup, BatchKey batchKey, MutationOperationGroup versionUpdateGroup, BatchKey versionUpdateBatchkey)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
decomposeForUpdate(Object id, Object rowId, Object[] values, UpdateCoordinatorStandard.UpdateValuesAnalysisImpl valuesAnalysis, MutationExecutor mutationExecutor, MutationOperationGroup jdbcOperationGroup, UpdateCoordinatorStandard.DirtinessChecker dirtinessChecker, SharedSessionContractImplementor session)
protected static int[]
dirtyAttributeIndexes(int[] incomingDirtyIndexes, int[] preUpdateGeneratedIndexes)
protected GeneratedValues
doDynamicUpdate(Object entity, Object id, Object rowId, Object[] values, Object[] oldValues, UpdateCoordinatorStandard.InclusionChecker dirtinessChecker, UpdateCoordinatorStandard.UpdateValuesAnalysisImpl valuesAnalysis, SharedSessionContractImplementor session)
protected GeneratedValues
doStaticUpdate(Object entity, Object id, Object rowId, Object[] values, Object[] oldValues, UpdateCoordinatorStandard.UpdateValuesAnalysisImpl valuesAnalysis, SharedSessionContractImplementor session)
protected GeneratedValues
doVersionUpdate(Object entity, Object id, Object version, Object oldVersion, boolean batching, SharedSessionContractImplementor session)
protected GeneratedValues
doVersionUpdate(Object entity, Object id, Object version, Object oldVersion, SharedSessionContractImplementor session)
void
forceVersionIncrement(Object id, Object currentVersion, Object nextVersion, boolean batching, SharedSessionContractImplementor session)
void
forceVersionIncrement(Object id, Object currentVersion, Object nextVersion, SharedSessionContractImplementor session)
protected MutationOperationGroup
generateDynamicUpdateGroup(Object entity, Object id, Object rowId, Object[] oldValues, UpdateCoordinatorStandard.UpdateValuesAnalysisImpl valuesAnalysis, SharedSessionContractImplementor session)
protected BatchKey
getBatchKey()
protected boolean[]
getPropertiesToUpdate(int[] dirtyProperties, boolean hasDirtyCollection)
Transform the array of property indexes to an array of booleans for each attribute, true when the property is dirtyboolean[]
getPropertyUpdateability(Object entity)
Which properties appear in the SQL update? (Initialized, updateable ones!)MutationOperationGroup
getStaticMutationOperationGroup()
The operation group used to perform the mutation unless some form of dynamic mutation is necessary.protected BatchKey
getVersionUpdateBatchkey()
protected MutationOperationGroup
getVersionUpdateGroup()
protected Supplier<GeneratedValues>
handlePotentialImplicitForcedVersionIncrement(Object entity, Object id, Object[] values, Object oldVersion, int[] incomingDirtyAttributeIndexes, SharedSessionContractImplementor session, EntityVersionMapping versionMapping)
boolean
isModifiableEntity(EntityEntry entry)
protected <O extends MutationOperation>
AbstractTableUpdateBuilder<O>newTableUpdateBuilder(EntityTableMapping tableMapping)
protected GeneratedValues
performUpdate(Object entity, Object id, Object rowId, Object[] values, Object oldVersion, Object[] incomingOldValues, boolean hasDirtyCollection, SharedSessionContractImplementor session, EntityVersionMapping versionMapping, int[] dirtyAttributeIndexes, boolean[] attributeUpdateability, boolean forceDynamicUpdate)
protected BatchKeyAccess
resolveUpdateVersionBatchKeyAccess(boolean dynamicUpdate, SharedSessionContractImplementor session)
String
toString()
GeneratedValues
update(Object entity, Object id, Object rowId, Object[] values, Object oldVersion, Object[] incomingOldValues, int[] incomingDirtyAttributeIndexes, boolean hasDirtyCollection, SharedSessionContractImplementor session)
Update a persistent instance.-
Methods inherited from class org.hibernate.persister.entity.mutation.AbstractMutationCoordinator
applyKeyRestriction, bindPartitionColumnValueBindings, breakDownKeyJdbcValues, createOperationGroup, dialect, entityPersister, factory, handleValueGeneration, needsRowId, resolveBatchKeyAccess
-
-
-
-
Constructor Detail
-
UpdateCoordinatorStandard
public UpdateCoordinatorStandard(AbstractEntityPersister entityPersister, SessionFactoryImplementor factory)
-
UpdateCoordinatorStandard
protected UpdateCoordinatorStandard(AbstractEntityPersister entityPersister, SessionFactoryImplementor factory, MutationOperationGroup staticUpdateGroup, BatchKey batchKey, MutationOperationGroup versionUpdateGroup, BatchKey versionUpdateBatchkey)
-
-
Method Detail
-
getStaticMutationOperationGroup
public MutationOperationGroup getStaticMutationOperationGroup()
Description copied from interface:MutationCoordinator
The operation group used to perform the mutation unless some form of dynamic mutation is necessary.- Specified by:
getStaticMutationOperationGroup
in interfaceMutationCoordinator
-
getVersionUpdateGroup
protected MutationOperationGroup getVersionUpdateGroup()
-
getBatchKey
protected BatchKey getBatchKey()
- Specified by:
getBatchKey
in classAbstractMutationCoordinator
-
isModifiableEntity
public final boolean isModifiableEntity(EntityEntry entry)
-
forceVersionIncrement
public void forceVersionIncrement(Object id, Object currentVersion, Object nextVersion, SharedSessionContractImplementor session)
- Specified by:
forceVersionIncrement
in interfaceUpdateCoordinator
-
forceVersionIncrement
public void forceVersionIncrement(Object id, Object currentVersion, Object nextVersion, boolean batching, SharedSessionContractImplementor session)
- Specified by:
forceVersionIncrement
in interfaceUpdateCoordinator
-
update
public GeneratedValues update(Object entity, Object id, Object rowId, Object[] values, Object oldVersion, Object[] incomingOldValues, int[] incomingDirtyAttributeIndexes, boolean hasDirtyCollection, SharedSessionContractImplementor session)
Description copied from interface:UpdateCoordinator
Update a persistent instance.- Specified by:
update
in interfaceUpdateCoordinator
- Returns:
- The generated values if any,
null
otherwise.
-
performUpdate
protected GeneratedValues performUpdate(Object entity, Object id, Object rowId, Object[] values, Object oldVersion, Object[] incomingOldValues, boolean hasDirtyCollection, SharedSessionContractImplementor session, EntityVersionMapping versionMapping, int[] dirtyAttributeIndexes, boolean[] attributeUpdateability, boolean forceDynamicUpdate)
-
dirtyAttributeIndexes
protected static int[] dirtyAttributeIndexes(int[] incomingDirtyIndexes, int[] preUpdateGeneratedIndexes)
-
handlePotentialImplicitForcedVersionIncrement
protected Supplier<GeneratedValues> handlePotentialImplicitForcedVersionIncrement(Object entity, Object id, Object[] values, Object oldVersion, int[] incomingDirtyAttributeIndexes, SharedSessionContractImplementor session, EntityVersionMapping versionMapping)
-
getPropertyUpdateability
public boolean[] getPropertyUpdateability(Object entity)
Which properties appear in the SQL update? (Initialized, updateable ones!)
-
doVersionUpdate
protected GeneratedValues doVersionUpdate(Object entity, Object id, Object version, Object oldVersion, SharedSessionContractImplementor session)
-
doVersionUpdate
protected GeneratedValues doVersionUpdate(Object entity, Object id, Object version, Object oldVersion, boolean batching, SharedSessionContractImplementor session)
-
getPropertiesToUpdate
protected boolean[] getPropertiesToUpdate(int[] dirtyProperties, boolean hasDirtyCollection)
Transform the array of property indexes to an array of booleans for each attribute, true when the property is dirty
-
doStaticUpdate
protected GeneratedValues doStaticUpdate(Object entity, Object id, Object rowId, Object[] values, Object[] oldValues, UpdateCoordinatorStandard.UpdateValuesAnalysisImpl valuesAnalysis, SharedSessionContractImplementor session)
-
decomposeForUpdate
protected void decomposeForUpdate(Object id, Object rowId, Object[] values, UpdateCoordinatorStandard.UpdateValuesAnalysisImpl valuesAnalysis, MutationExecutor mutationExecutor, MutationOperationGroup jdbcOperationGroup, UpdateCoordinatorStandard.DirtinessChecker dirtinessChecker, SharedSessionContractImplementor session)
-
doDynamicUpdate
protected GeneratedValues doDynamicUpdate(Object entity, Object id, Object rowId, Object[] values, Object[] oldValues, UpdateCoordinatorStandard.InclusionChecker dirtinessChecker, UpdateCoordinatorStandard.UpdateValuesAnalysisImpl valuesAnalysis, SharedSessionContractImplementor session)
-
resolveUpdateVersionBatchKeyAccess
protected BatchKeyAccess resolveUpdateVersionBatchKeyAccess(boolean dynamicUpdate, SharedSessionContractImplementor session)
-
getVersionUpdateBatchkey
protected BatchKey getVersionUpdateBatchkey()
-
generateDynamicUpdateGroup
protected MutationOperationGroup generateDynamicUpdateGroup(Object entity, Object id, Object rowId, Object[] oldValues, UpdateCoordinatorStandard.UpdateValuesAnalysisImpl valuesAnalysis, SharedSessionContractImplementor session)
-
newTableUpdateBuilder
protected <O extends MutationOperation> AbstractTableUpdateBuilder<O> newTableUpdateBuilder(EntityTableMapping tableMapping)
-
-