public interface OptimisticLockingPolicy extends Cloneable, Serializable
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.
|
Object |
clone() |
int |
compareWriteLockValues(Object value1,
Object value2)
INTERNAL:
This method compares two writeLockValues.
|
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.
|
Object |
getValueToPutInCache(AbstractRecord row,
AbstractSession session)
INTERNAL:
Return the value that should be stored in the identity map.
|
int |
getVersionDifference(Object currentValue,
Object domainObject,
Vector primaryKeys,
AbstractSession session)
PUBLIC:
Return the number of versions different between these objects.
|
DatabaseField |
getWriteLockField()
INTERNAL:
Return the write lock field.
|
Expression |
getWriteLockUpdateExpression(ExpressionBuilder builder)
INTERNAL:
This method will return an expression that is used to update its optimistic
locking field.
|
Object |
getWriteLockValue(Object domainObject,
Vector 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 |
isChildWriteLockValueGreater(AbstractSession session,
Vector primaryKey,
Class original,
ObjectChangeSet changeSet)
INTERNAL:
Update the parent write lock value if the changeSet's is newer
|
boolean |
isChildWriteLockValueGreater(UnitOfWorkImpl uow,
Vector primaryKey,
Class original)
INTERNAL:
Update the parent write lock value if the unit of works has been incremented
|
boolean |
isNewerVersion(AbstractRecord databaseRow,
Object domainObject,
Vector primaryKey,
AbstractSession session)
INTERNAL:
Returns true if the value stored with the domainObject is more recent
than the value in the row.
|
boolean |
isNewerVersion(Object currentValue,
Object domainObject,
Vector primaryKey,
AbstractSession session)
INTERNAL:
Returns true if the value stored with the domainObject is more recent
than the value .
|
void |
mergeIntoParentCache(UnitOfWorkImpl uow,
Vector primaryKey,
Object object)
INTERNAL:
This method should merge changes from the parent into the child.
|
void |
prepareFetchGroupForReadQuery(FetchGroup fetchGroup,
ObjectLevelReadQuery query)
INTERNAL:
Prepare fetch group for read query
|
void |
setDescriptor(ClassDescriptor descriptor)
INTERNAL:
provide a way to set the descriptor for this policy
|
void |
setupWriteFieldsForInsert(ObjectLevelModifyQuery query)
INTERNAL:
Add the initial right lock values to the modify
row in the query.
|
void |
updateRowAndObjectForUpdate(ObjectLevelModifyQuery query,
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,
Object object,
WriteObjectQuery query) |
void |
validateUpdate(int rowCount,
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)
Object clone()
int compareWriteLockValues(Object value1, Object value2)
Object getBaseValue()
Object getValueToPutInCache(AbstractRecord row, AbstractSession session)
int getVersionDifference(Object currentValue, Object domainObject, Vector primaryKeys, AbstractSession session)
DatabaseField getWriteLockField()
Object getWriteLockValue(Object domainObject, Vector primaryKey, AbstractSession session)
Expression getWriteLockUpdateExpression(ExpressionBuilder builder)
void initialize(AbstractSession session)
void initializeProperties()
boolean isChildWriteLockValueGreater(AbstractSession session, Vector primaryKey, Class original, ObjectChangeSet changeSet)
boolean isChildWriteLockValueGreater(UnitOfWorkImpl uow, Vector primaryKey, Class original)
boolean isNewerVersion(Object currentValue, Object domainObject, Vector primaryKey, AbstractSession session)
boolean isNewerVersion(AbstractRecord databaseRow, Object domainObject, Vector primaryKey, AbstractSession session)
void mergeIntoParentCache(UnitOfWorkImpl uow, Vector primaryKey, Object object)
void setDescriptor(ClassDescriptor descriptor)
void setupWriteFieldsForInsert(ObjectLevelModifyQuery query)
void updateRowAndObjectForUpdate(ObjectLevelModifyQuery query, Object object)
void validateDelete(int rowCount, Object object, WriteObjectQuery query)
void validateUpdate(int rowCount, Object object, WriteObjectQuery query)
void prepareFetchGroupForReadQuery(FetchGroup fetchGroup, ObjectLevelReadQuery query)
Copyright © 2021. All rights reserved.