|
EclipseLink 1.0_1.0M2 API Reference - Incubation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.descriptors.FieldsLockingPolicy
public abstract class FieldsLockingPolicy
Purpose: An abstract superclass of some implementations of the OptimisticLockingPolicy interface. All of the subclasses of this class implement OptimisticLocking based on mapped fields in the object. These fields are only compared and not modified. Any modification (incrementing etc..) must be handled by the application.
AllFieldsLockingPolicy
,
ChangedFieldsLockingPolicy
,
SelectedFieldsLockingPolicy
Field Summary | |
---|---|
protected java.util.Vector |
allNonPrimaryKeyFields
|
protected ClassDescriptor |
descriptor
|
Constructor Summary | |
---|---|
FieldsLockingPolicy()
PUBLIC: Create a new field locking policy. |
Method Summary | |
---|---|
void |
addLockFieldsToUpdateRow(AbstractRecord Record,
AbstractSession session)
INTERNAL: Add update fields for template row. |
abstract void |
addLockValuesToTranslationRow(ObjectLevelModifyQuery query)
INTERNAL: Values to be included in the locking mechanism are added to the translation row. |
protected java.util.Vector |
buildAllNonPrimaryKeyFields()
INTERNAL: Returns the fields that should be compared in the where clause. |
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. |
protected Expression |
buildExpression(DatabaseTable table,
AbstractRecord transRow,
AbstractRecord modifyRow,
ExpressionBuilder builder)
INTERNAL: returns the expression to be used in both the delete and update where clause. |
Expression |
buildUpdateExpression(DatabaseTable table,
Expression mainExpression,
AbstractRecord transRow,
AbstractRecord modifyRow)
INTERNAL: This method must be included in any locking policy. |
java.lang.Object |
clone()
INTERNAL: Clone the policy |
int |
compareWriteLockValues(java.lang.Object value1,
java.lang.Object value2)
INTERNAL: This method shouldn't be called if supportsWriteLockValuesComparison() returns false. |
protected java.util.Vector |
getAllNonPrimaryKeyFields()
INTERNAL: Returns the fields that should be compared in the where clause. |
protected java.util.Vector |
getAllNonPrimaryKeyFields(DatabaseTable table)
INTERNAL: filter the fields based on the passed in table. |
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. |
protected abstract java.util.Vector |
getFieldsToCompare(DatabaseTable table,
AbstractRecord transRow,
AbstractRecord modifyRow)
INTERNAL: Returns the fields that should be compared in the where clause. |
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.util.Vector primaryKeys,
AbstractSession session)
INTERNAL: Return the number of version difference between the two states of the object. |
DatabaseField |
getWriteLockField()
INTERNAL: Return the write lock field. |
Expression |
getWriteLockUpdateExpression(ExpressionBuilder builder)
INTERNAL: |
java.lang.Object |
getWriteLockValue(java.lang.Object domainObject,
java.util.Vector primaryKey,
AbstractSession session)
INTERNAL: This method will return the optimistic lock value for the object |
void |
initialize(AbstractSession session)
INTERNAL: It is responsible for initializing the policy; |
void |
initializeProperties()
INTERNAL: It is responsible for initializing the policy; |
boolean |
isCascaded()
PUBLIC: Return true if the policy uses cascade locking. |
boolean |
isChildWriteLockValueGreater(AbstractSession session,
java.util.Vector primaryKey,
java.lang.Class original,
ObjectChangeSet changeSet)
INTERNAL: |
boolean |
isNewerVersion(java.lang.Object currentValue,
java.lang.Object domainObject,
java.util.Vector primaryKey,
AbstractSession session)
INTERNAL: Compares the value and the value from the object (or cache). |
protected boolean |
isPrimaryKey(DatabaseField dbField)
INTERNAL: Returns whether or not this field is a primary key. |
boolean |
isStoredInCache()
PUBLIC: Return true if the lock value is stored in the cache. |
void |
mergeIntoParentCache(UnitOfWorkImpl uow,
java.util.Vector primaryKey,
java.lang.Object object)
INTERNAL: Only applicable when the value is stored in the cache. |
protected void |
setAllNonPrimaryKeyFields(java.util.Vector allNonPrimaryKeyFields)
INTERNAL: Set method for all the primary keys |
void |
setDescriptor(ClassDescriptor descriptor)
INTERNAL: Set method for the descriptor |
void |
setupWriteFieldsForInsert(ObjectLevelModifyQuery query)
INTERNAL: Put the initial writelock value into the modifyRow. |
boolean |
supportsWriteLockValuesComparison()
INTERNAL: Indicates whether compareWriteLockValues method is supported by the policy. |
void |
updateRowAndObjectForUpdate(ObjectLevelModifyQuery query,
java.lang.Object domainObject)
INTERNAL: Nothing to do because all updates are handled by the application |
void |
validateDelete(int rowCount,
java.lang.Object object,
DeleteObjectQuery query)
INTERNAL: Check the row count for lock failure. |
void |
validateUpdate(int rowCount,
java.lang.Object object,
WriteObjectQuery query)
INTERNAL: Check the row count for lock failure. |
protected void |
verifyUsage(AbstractSession session)
INTERNAL: throw an exception if not inside a unit of work at this point |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ClassDescriptor descriptor
protected java.util.Vector allNonPrimaryKeyFields
Constructor Detail |
---|
public FieldsLockingPolicy()
Method Detail |
---|
public void addLockFieldsToUpdateRow(AbstractRecord Record, AbstractSession session)
public abstract void addLockValuesToTranslationRow(ObjectLevelModifyQuery query)
protected java.util.Vector buildAllNonPrimaryKeyFields()
public Expression buildDeleteExpression(DatabaseTable table, Expression mainExpression, AbstractRecord row)
protected Expression buildExpression(DatabaseTable table, AbstractRecord transRow, AbstractRecord modifyRow, ExpressionBuilder builder)
public Expression buildUpdateExpression(DatabaseTable table, Expression mainExpression, AbstractRecord transRow, AbstractRecord modifyRow)
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean supportsWriteLockValuesComparison()
public int compareWriteLockValues(java.lang.Object value1, java.lang.Object value2)
protected java.util.Vector getAllNonPrimaryKeyFields()
protected java.util.Vector getAllNonPrimaryKeyFields(DatabaseTable table)
public java.lang.Object getBaseValue()
protected abstract java.util.Vector getFieldsToCompare(DatabaseTable table, AbstractRecord transRow, AbstractRecord modifyRow)
public DatabaseField getWriteLockField()
public Expression getWriteLockUpdateExpression(ExpressionBuilder builder)
public java.lang.Object getValueToPutInCache(AbstractRecord row, AbstractSession session)
public int getVersionDifference(java.lang.Object currentValue, java.lang.Object domainObject, java.util.Vector primaryKeys, AbstractSession session)
public java.lang.Object getWriteLockValue(java.lang.Object domainObject, java.util.Vector primaryKey, AbstractSession session)
public void initialize(AbstractSession session)
public void initializeProperties()
public boolean isStoredInCache()
public boolean isCascaded()
public boolean isChildWriteLockValueGreater(AbstractSession session, java.util.Vector primaryKey, java.lang.Class original, ObjectChangeSet changeSet)
public boolean isNewerVersion(java.lang.Object currentValue, java.lang.Object domainObject, java.util.Vector primaryKey, AbstractSession session)
protected boolean isPrimaryKey(DatabaseField dbField)
public void mergeIntoParentCache(UnitOfWorkImpl uow, java.util.Vector primaryKey, java.lang.Object object)
protected void setAllNonPrimaryKeyFields(java.util.Vector allNonPrimaryKeyFields)
public void setDescriptor(ClassDescriptor descriptor)
public void setupWriteFieldsForInsert(ObjectLevelModifyQuery query)
public void updateRowAndObjectForUpdate(ObjectLevelModifyQuery query, java.lang.Object domainObject)
public void validateDelete(int rowCount, java.lang.Object object, DeleteObjectQuery query)
public void validateUpdate(int rowCount, java.lang.Object object, WriteObjectQuery query)
protected void verifyUsage(AbstractSession session)
|
EclipseLink 1.0_1.0M2 API Reference - Incubation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |