public interface OptimisticLockingPolicy
extends java.lang.Cloneable, java.io.Serializable
Modifier and Type | Interface and Description |
---|---|
static class |
OptimisticLockingPolicy.LockOnChange
Advanced:
|
Modifier and Type | Method and Description |
---|---|
void |
addLockFieldsToUpdateRow(AbstractRecord databaseRow,
AbstractSession session)
INTERNAL:
Add update fields for template row.
|
void |
addLockValuesToTranslationRow(ObjectLevelModifyQuery query)
INTERNAL:
The method should update the translation row with the
correct write lock values.
|
Expression |
buildDeleteExpression(DatabaseTable table,
Expression mainExpression,
AbstractRecord row)
INTERNAL:
When given an expression, this method will return a new expression with
the optimistic locking values included.
|
Expression |
buildUpdateExpression(DatabaseTable table,
Expression mainExpression,
AbstractRecord translationRow,
AbstractRecord modifyRow)
INTERNAL:
When given an expression, this method will return a new expression with
the optimistic locking values included.
|
java.lang.Object |
clone() |
int |
compareWriteLockValues(java.lang.Object value1,
java.lang.Object value2)
INTERNAL:
This method shouldn't be called if supportsWriteLockValuesComparison() returns false.
|
java.lang.Object |
getBaseValue()
INTERNAL:
This is the base value that is older than all other values, it is used in the place of
null in some situations.
|
OptimisticLockingPolicy.LockOnChange |
getLockOnChangeMode()
ADVANCED:
returns the LockOnChange mode for this policy.
|
java.lang.Object |
getValueToPutInCache(AbstractRecord row,
AbstractSession session)
INTERNAL:
Return the value that should be stored in the identity map.
|
int |
getVersionDifference(java.lang.Object currentValue,
java.lang.Object domainObject,
java.lang.Object primaryKey,
AbstractSession session)
PUBLIC:
Return the number of versions different between these objects.
|
DatabaseField |
getWriteLockField()
INTERNAL:
Return the write lock field.
|
Expression |
getWriteLockUpdateExpression(ExpressionBuilder builder,
AbstractSession session)
INTERNAL:
This method will return an expression that is used to update its optimistic locking field
#see this method in VersionLockingPolicy
|
java.lang.Object |
getWriteLockValue(java.lang.Object domainObject,
java.lang.Object primaryKey,
AbstractSession session)
INTERNAL:
This method will return the optimistic lock value for the object
#see this method in VersionLockingPolicy
|
void |
initialize(AbstractSession session)
INTERNAL:
It is responsible for initializing the policy.
|
void |
initializeProperties()
INTERNAL:
Responsible for pre-initializing.
|
boolean |
isCascaded()
INTERNAL:
Specify if the policy cascade locks.
|
boolean |
isNewerVersion(AbstractRecord databaseRow,
java.lang.Object domainObject,
java.lang.Object primaryKey,
AbstractSession session)
INTERNAL:
Returns true if the value stored with the domainObject is more recent
than the value in the row.
|
boolean |
isNewerVersion(java.lang.Object currentValue,
java.lang.Object domainObject,
java.lang.Object primaryKey,
AbstractSession session)
INTERNAL:
Returns true if the value stored with the domainObject is more recent
than the value .
|
boolean |
isStoredInCache()
INTERNAL:
Return true if the lock value is stored in the cache.
|
void |
mergeIntoParentCache(CacheKey unitOfWorkCacheKey,
CacheKey parentSessionCacheKey)
INTERNAL:
This method should merge changes from the parent into the child.
|
void |
mergeIntoParentCache(UnitOfWorkImpl uow,
java.lang.Object primaryKey,
java.lang.Object object)
INTERNAL:
This method should merge changes from the parent into the child.
|
void |
setDescriptor(ClassDescriptor descriptor)
INTERNAL:
provide a way to set the descriptor for this policy
|
void |
setLockOnChangeMode(OptimisticLockingPolicy.LockOnChange lockOnChangeMode)
ADVANCED:
Sets the LockOnChange mode for this policy.
|
void |
setupWriteFieldsForInsert(ObjectLevelModifyQuery query)
INTERNAL:
Add the initial right lock values to the modify
row in the query.
|
boolean |
shouldUpdateVersionOnMappingChange()
INTERNAL:
Returns true if the policy has been set to set an optimistic read lock when any mapping changes.
|
boolean |
shouldUpdateVersionOnOwnedMappingChange()
INTERNAL:
Returns true if the policy has been set to set an optimistic read lock when a owning mapping changes.
|
boolean |
supportsWriteLockValuesComparison()
INTERNAL:
Indicates whether compareWriteLockValues method is supported by the policy.
|
void |
updateRowAndObjectForUpdate(ObjectLevelModifyQuery query,
java.lang.Object object)
INTERNAL:
This method should update the translation row, the modify
row and the domain object with th lock value.
|
void |
validateDelete(int rowCount,
java.lang.Object object,
DeleteObjectQuery query) |
void |
validateUpdate(int rowCount,
java.lang.Object object,
WriteObjectQuery query) |
void addLockFieldsToUpdateRow(AbstractRecord databaseRow, AbstractSession session)
void addLockValuesToTranslationRow(ObjectLevelModifyQuery query)
Expression buildDeleteExpression(DatabaseTable table, Expression mainExpression, AbstractRecord row)
Expression buildUpdateExpression(DatabaseTable table, Expression mainExpression, AbstractRecord translationRow, AbstractRecord modifyRow)
java.lang.Object clone()
boolean supportsWriteLockValuesComparison()
int compareWriteLockValues(java.lang.Object value1, java.lang.Object value2)
java.lang.Object getBaseValue()
OptimisticLockingPolicy.LockOnChange getLockOnChangeMode()
java.lang.Object getValueToPutInCache(AbstractRecord row, AbstractSession session)
int getVersionDifference(java.lang.Object currentValue, java.lang.Object domainObject, java.lang.Object primaryKey, AbstractSession session)
DatabaseField getWriteLockField()
java.lang.Object getWriteLockValue(java.lang.Object domainObject, java.lang.Object primaryKey, AbstractSession session)
Expression getWriteLockUpdateExpression(ExpressionBuilder builder, AbstractSession session)
void initialize(AbstractSession session)
void initializeProperties()
boolean isStoredInCache()
boolean isCascaded()
boolean isNewerVersion(java.lang.Object currentValue, java.lang.Object domainObject, java.lang.Object primaryKey, AbstractSession session)
boolean isNewerVersion(AbstractRecord databaseRow, java.lang.Object domainObject, java.lang.Object primaryKey, AbstractSession session)
void mergeIntoParentCache(UnitOfWorkImpl uow, java.lang.Object primaryKey, java.lang.Object object)
void mergeIntoParentCache(CacheKey unitOfWorkCacheKey, CacheKey parentSessionCacheKey)
void setDescriptor(ClassDescriptor descriptor)
void setLockOnChangeMode(OptimisticLockingPolicy.LockOnChange lockOnChangeMode)
void setupWriteFieldsForInsert(ObjectLevelModifyQuery query)
void updateRowAndObjectForUpdate(ObjectLevelModifyQuery query, java.lang.Object object)
boolean shouldUpdateVersionOnOwnedMappingChange()
boolean shouldUpdateVersionOnMappingChange()
void validateDelete(int rowCount, java.lang.Object object, DeleteObjectQuery query)
void validateUpdate(int rowCount, java.lang.Object object, WriteObjectQuery query)
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference