public class AllFieldsLockingPolicy extends FieldsLockingPolicy
Purpose: An implementation of the OptimisticLockingPolicy interface. This policy compares every field in the table in the WHERE clause when doing an update or a delete. If any field has been changed, an optimistic locking exception will be thrown.
NOTE: This policy can only be used inside a unit of work.
allNonPrimaryKeyFields, descriptor
Constructor and Description |
---|
AllFieldsLockingPolicy()
PUBLIC:
Create a new all 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.
|
protected java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> |
getFieldsToCompare(org.eclipse.persistence.internal.helper.DatabaseTable table,
org.eclipse.persistence.internal.sessions.AbstractRecord transRow,
org.eclipse.persistence.internal.sessions.AbstractRecord modifyRow)
INTERNAL:
Returns the fields that should be compared in the where clause.
|
addLockFieldsToUpdateRow, buildAllNonPrimaryKeyFields, buildDeleteExpression, buildExpression, buildUpdateExpression, clone, compareWriteLockValues, getAllNonPrimaryKeyFields, getAllNonPrimaryKeyFields, getBaseValue, getLockOnChangeMode, getValueToPutInCache, getVersionDifference, getWriteLockField, getWriteLockUpdateExpression, getWriteLockValue, initialize, initializeProperties, isCascaded, isNewerVersion, isNewerVersion, isPrimaryKey, isStoredInCache, mergeIntoParentCache, mergeIntoParentCache, setAllNonPrimaryKeyFields, setDescriptor, setLockOnChangeMode, setupWriteFieldsForInsert, shouldUpdateVersionOnMappingChange, shouldUpdateVersionOnOwnedMappingChange, supportsWriteLockValuesComparison, updateRowAndObjectForUpdate, validateDelete, validateUpdate, verifyUsage
public AllFieldsLockingPolicy()
public void addLockValuesToTranslationRow(ObjectLevelModifyQuery query)
addLockValuesToTranslationRow
in interface org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy
addLockValuesToTranslationRow
in class FieldsLockingPolicy
protected java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getFieldsToCompare(org.eclipse.persistence.internal.helper.DatabaseTable table, org.eclipse.persistence.internal.sessions.AbstractRecord transRow, org.eclipse.persistence.internal.sessions.AbstractRecord modifyRow)
getFieldsToCompare
in class FieldsLockingPolicy