public class ChangedFieldsLockingPolicy extends FieldsLockingPolicy
Purpose: An implementation of the OptimisticLockingPolicy interface. This policy compares only the changed fields in the WHERE clause when doing an update. If any field has been changed, an optimistic locking exception will be thrown. A delete will only compare the primary key.
NOTE: This policy can only be used inside a unit of work.
Constructor and Description |
---|
ChangedFieldsLockingPolicy()
PUBLIC: Create a new changed fields locking policy.
|
Modifier and Type | Method and Description |
---|---|
void |
addLockValuesToTranslationRow(ObjectLevelModifyQuery query)
INTERNAL: Values to be included in the locking mechanism are added to the translation row.
|
Expression |
buildDeleteExpression(org.eclipse.persistence.internal.helper.DatabaseTable table, Expression mainExpression, org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL: When given an expression, this method will return a new expression with the optimistic locking values included.
|
addLockFieldsToUpdateRow, buildUpdateExpression, clone, compareWriteLockValues, getBaseValue, getLockOnChangeMode, getValueToPutInCache, getVersionDifference, getWriteLockField, getWriteLockUpdateExpression, getWriteLockValue, initialize, initializeProperties, isCascaded, isNewerVersion, isNewerVersion, isStoredInCache, mergeIntoParentCache, mergeIntoParentCache, setDescriptor, setLockOnChangeMode, setupWriteFieldsForInsert, shouldUpdateVersionOnMappingChange, shouldUpdateVersionOnOwnedMappingChange, supportsWriteLockValuesComparison, updateRowAndObjectForUpdate, validateDelete, validateUpdate
public ChangedFieldsLockingPolicy()
public void addLockValuesToTranslationRow(ObjectLevelModifyQuery query)
addLockValuesToTranslationRow
in interface org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy
addLockValuesToTranslationRow
in class FieldsLockingPolicy
public Expression buildDeleteExpression(org.eclipse.persistence.internal.helper.DatabaseTable table, Expression mainExpression, org.eclipse.persistence.internal.sessions.AbstractRecord row)
buildDeleteExpression
in interface org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy
buildDeleteExpression
in class FieldsLockingPolicy