java.lang.Object
org.eclipse.persistence.descriptors.VersionLockingPolicy
org.eclipse.persistence.descriptors.AbstractTsLockingPolicy<Timestamp>
org.eclipse.persistence.descriptors.TimestampLockingPolicy
- All Implemented Interfaces:
Serializable,Cloneable,org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy
Purpose: Used to allow a single version timestamp to be used for optimistic locking.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy
org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy.LockOnChange -
Field Summary
Fields inherited from class org.eclipse.persistence.descriptors.AbstractTsLockingPolicy
LOCAL_TIME, SERVER_TIMEFields inherited from class org.eclipse.persistence.descriptors.VersionLockingPolicy
cachedExpression, descriptor, IN_CACHE, IN_OBJECT, isCascaded, lockMapping, lockOnChangeMode, lockValueStored, writeLockField -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new TimestampLockingPolicy.TimestampLockingPolicy(String fieldName) Create a new TimestampLockingPolicy. -
Method Summary
Modifier and TypeMethodDescriptionintgetVersionDifference(Object currentValue, Object domainObject, Object primaryKeys, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Return the number of versions different between these objects.Methods inherited from class org.eclipse.persistence.descriptors.AbstractTsLockingPolicy
compareWriteLockValues, create, getBaseValue, getDefaultLockingFieldType, getInitialWriteValue, getNewLockValue, getValueToPutInCache, getWriteLockUpdateExpression, getWriteLockValue, incrementWriteLockValue, isNewerVersion, isNewerVersion, isNewerVersion, setUsesServerTime, useLocalTime, useServerTime, usesLocalTime, usesServerTimeMethods inherited from class org.eclipse.persistence.descriptors.VersionLockingPolicy
addLockFieldsToUpdateRow, addLockValuesToTranslationRow, buildDeleteExpression, buildExpression, buildUpdateExpression, clone, getDescriptor, getLockOnChangeMode, getUnmappedFields, getVersion, getVersionMapping, getWriteLockField, getWriteLockFieldName, initialize, initializeProperties, isCascaded, isStoredInCache, isStoredInObject, lockValueFromObject, mergeIntoParentCache, mergeIntoParentCache, setDescriptor, setIsCascaded, setIsStoredInCache, setLockOnChangeMode, setupWriteFieldsForInsert, setWriteLockField, setWriteLockFieldName, shouldUpdateVersionOnMappingChange, shouldUpdateVersionOnOwnedMappingChange, storeInCache, storeInObject, supportsWriteLockValuesComparison, updateObjectWithWriteValue, updateRowAndObjectForUpdate, updateWriteLockValueForWrite, validateDelete, validateUpdate, writeLockValueIntoRow
-
Constructor Details
-
TimestampLockingPolicy
public TimestampLockingPolicy()Create a new TimestampLockingPolicy. Defaults to using the time retrieved from the server. -
TimestampLockingPolicy
Create a new TimestampLockingPolicy. Defaults to using the time retrieved from the server.- Parameters:
fieldName- the field where the write lock value will be stored
-
-
Method Details
-
getVersionDifference
public int getVersionDifference(Object currentValue, Object domainObject, Object primaryKeys, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Return the number of versions different between these objects.- Specified by:
getVersionDifferencein interfaceorg.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy- Overrides:
getVersionDifferencein classVersionLockingPolicy- Parameters:
currentValue- the new lock valuedomainObject- the object containing the version to be compared toprimaryKeys- a vector containing the primary keys of the domainObjectsession- the session to be used with the comparison
-