FileDocCategorySizeDatePackage
OptimisticLockingPolicy.javaAPI DocGlassfish v2 API9142Tue May 22 16:54:22 BST 2007oracle.toplink.essentials.internal.descriptors

OptimisticLockingPolicy

public interface OptimisticLockingPolicy implements Serializable, Cloneable

Fields Summary
Constructors Summary
Methods Summary
public voidaddLockFieldsToUpdateRow(oracle.toplink.essentials.internal.sessions.AbstractRecord databaseRow, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Add update fields for template row. These are any unmapped fields required to write in an update. #see this method in VersionLockingPolicy

public voidaddLockValuesToTranslationRow(oracle.toplink.essentials.queryframework.ObjectLevelModifyQuery query)
INTERNAL: The method should update the translation row with the correct write lock values. This method is called on a delete. #see this method in VersionLockingPolicy

public oracle.toplink.essentials.expressions.ExpressionbuildDeleteExpression(oracle.toplink.essentials.internal.helper.DatabaseTable table, oracle.toplink.essentials.expressions.Expression mainExpression, oracle.toplink.essentials.internal.sessions.AbstractRecord row)
INTERNAL: When given an expression, this method will return a new expression with the optimistic locking values included. This expression will be used in a delete call. #see this method in VersionLockingPolicy

public oracle.toplink.essentials.expressions.ExpressionbuildUpdateExpression(oracle.toplink.essentials.internal.helper.DatabaseTable table, oracle.toplink.essentials.expressions.Expression mainExpression, oracle.toplink.essentials.internal.sessions.AbstractRecord translationRow, oracle.toplink.essentials.internal.sessions.AbstractRecord modifyRow)
INTERNAL: When given an expression, this method will return a new expression with the optimistic locking values included. This expression will be used in an update call. #see this method in VersionLockingPolicy

public java.lang.Objectclone()

public intcompareWriteLockValues(java.lang.Object value1, java.lang.Object value2)
INTERNAL: This method compares two writeLockValues. The writeLockValues should be non-null and of the correct type. Returns: -1 if value1 is less (older) than value2; 0 if value1 equals value2; 1 if value1 is greater (newer) than value2. Throws: NullPointerException if the passed value is null; ClassCastException if the passed value is of a wrong type.

public abstract java.lang.ObjectgetBaseValue()
INTERNAL: This is the base value that is older than all other values, it is used in the place of null in some situations.

public java.lang.ObjectgetValueToPutInCache(oracle.toplink.essentials.internal.sessions.AbstractRecord row, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Return the value that should be stored in the identity map. If the value is not stored in the cache, then return a null. #see this method in VersionLockingPolicy

public intgetVersionDifference(java.lang.Object currentValue, java.lang.Object domainObject, java.util.Vector primaryKeys, oracle.toplink.essentials.internal.sessions.AbstractSession session)
PUBLIC: Return the number of versions different between these objects.

public oracle.toplink.essentials.internal.helper.DatabaseFieldgetWriteLockField()
INTERNAL: Return the write lock field. #see this method in VersionLockingPolicy

public oracle.toplink.essentials.expressions.ExpressiongetWriteLockUpdateExpression(oracle.toplink.essentials.expressions.ExpressionBuilder builder)
INTERNAL: This method will return an expression that is used to update its optimistic locking field. #see this method in VersionLockingPolicy

public java.lang.ObjectgetWriteLockValue(java.lang.Object domainObject, java.util.Vector primaryKey, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: This method will return the optimistic lock value for the object #see this method in VersionLockingPolicy

public voidinitialize(oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: It is responsible for initializing the policy. #see this method in VersionLockingPolicy

public voidinitializeProperties()
INTERNAL: Responsible for pre-initializing. #see this method in VersionLockingPolicy

public booleanisChildWriteLockValueGreater(oracle.toplink.essentials.internal.sessions.AbstractSession session, java.util.Vector primaryKey, java.lang.Class original, oracle.toplink.essentials.internal.sessions.ObjectChangeSet changeSet)
INTERNAL: Update the parent write lock value if the changeSet's is newer

public booleanisChildWriteLockValueGreater(oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl uow, java.util.Vector primaryKey, java.lang.Class original)
INTERNAL: Update the parent write lock value if the unit of works has been incremented

public booleanisNewerVersion(java.lang.Object currentValue, java.lang.Object domainObject, java.util.Vector primaryKey, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Returns true if the value stored with the domainObject is more recent than the value . Returns false otherwise. #see this method in VersionLockingPolicy

public booleanisNewerVersion(oracle.toplink.essentials.internal.sessions.AbstractRecord databaseRow, java.lang.Object domainObject, java.util.Vector primaryKey, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Returns true if the value stored with the domainObject is more recent than the value in the row. Returns false otherwise. NOTE: This method will only be called if the shouldOnlyRefreshCacheIfNewerVersion() flag is set on descriptor. #see this method in VersionLockingPolicy

public voidmergeIntoParentCache(oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl uow, java.util.Vector primaryKey, java.lang.Object object)
INTERNAL: This method should merge changes from the parent into the child. #see this method in VersionLockingPolicy

public voidprepareFetchGroupForReadQuery(oracle.toplink.essentials.queryframework.FetchGroup fetchGroup, oracle.toplink.essentials.queryframework.ObjectLevelReadQuery query)
INTERNAL: Prepare fetch group for read query

public voidsetDescriptor(oracle.toplink.essentials.descriptors.ClassDescriptor descriptor)
INTERNAL: provide a way to set the descriptor for this policy

public voidsetupWriteFieldsForInsert(oracle.toplink.essentials.queryframework.ObjectLevelModifyQuery query)
INTERNAL: Add the initial right lock values to the modify row in the query. This method will only be called on insert. #see this method in VersionLockingPolicy

public voidupdateRowAndObjectForUpdate(oracle.toplink.essentials.queryframework.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. #see this method in VersionLockingPolicy

public voidvalidateDelete(int rowCount, java.lang.Object object, oracle.toplink.essentials.queryframework.WriteObjectQuery query)

public voidvalidateUpdate(int rowCount, java.lang.Object object, oracle.toplink.essentials.queryframework.WriteObjectQuery query)