java.lang.Object
org.eclipse.persistence.descriptors.VersionLockingPolicy
org.eclipse.persistence.descriptors.AbstractTsLockingPolicy<Instant>
org.eclipse.persistence.descriptors.InstantLockingPolicy
- All Implemented Interfaces:
Serializable,Cloneable,org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy
Version policy used for optimistic locking with
Instant field.- 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 instance of version policy used for optimistic locking withInstantfield.InstantLockingPolicy(String fieldName) Create a new instance of version policy used for optimistic locking withInstantfield. -
Method Summary
Modifier and TypeMethodDescriptionintgetVersionDifference(Object currentValue, Object domainObject, Object primaryKeys, org.eclipse.persistence.internal.sessions.AbstractSession session) PUBLIC: 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
-
InstantLockingPolicy
public InstantLockingPolicy()Create a new instance of version policy used for optimistic locking withInstantfield. Defaults to using the time retrieved from the server. -
InstantLockingPolicy
Create a new instance of version policy used for optimistic locking withInstantfield. 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) Description copied from class:VersionLockingPolicyPUBLIC: 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
-