|
Oracle Application Server TopLink API Reference 10g Release 2 (10.1.2) B15903-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.toplink.descriptors.VersionLockingPolicy
Purpose: Used to allow a single version number to be used for optimistic locking.
Field Summary | |
static int |
IN_CACHE |
static int |
IN_OBJECT |
Constructor Summary | |
VersionLockingPolicy() PUBLIC: Create a new VersionLockingPolicy. |
|
VersionLockingPolicy(oracle.toplink.internal.helper.DatabaseField field) PUBLIC: Create a new VersionLockingPolicy. |
|
VersionLockingPolicy(java.lang.String fieldName) PUBLIC: Create a new VersionLockingPolicy. |
Method Summary | |
int |
getVersionDifference(java.lang.Object currentValue, java.lang.Object domainObject, java.util.Vector primaryKeys, oracle.toplink.publicinterface.Session session) PUBLIC: Return the number of versions different between these objects. |
java.lang.String |
getWriteLockFieldName() PUBLIC: Return the field name of the field that stores the write lock value. |
boolean |
isStoredInCache() PUBLIC: Return true if the lock value is stored in the cache. |
boolean |
isStoredInObject() PUBLIC: Return true if the lock value is stored in the object. |
void |
setIsStoredInCache(boolean isStoredInCache) PUBLIC: Set whether to store the locak in the cache or in the object. |
void |
setWriteLockFieldName(java.lang.String writeLockFieldName) PUBLIC: Set the write lock field name. |
void |
storeInCache() PUBLIC: Configure the version lock value to be stored in the cache. |
void |
storeInObject() PUBLIC: Configure the version lock value to be stored in the object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int IN_CACHE
public static final int IN_OBJECT
Constructor Detail |
public VersionLockingPolicy()
public VersionLockingPolicy(java.lang.String fieldName)
fieldName
- specifies the field name for the write lock field.public VersionLockingPolicy(oracle.toplink.internal.helper.DatabaseField field)
Method Detail |
public int getVersionDifference(java.lang.Object currentValue, java.lang.Object domainObject, java.util.Vector primaryKeys, oracle.toplink.publicinterface.Session session)
getVersionDifference
in interface oracle.toplink.internal.descriptors.OptimisticLockingPolicy
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 comparisonpublic java.lang.String getWriteLockFieldName()
public boolean isStoredInCache()
public boolean isStoredInObject()
public void setIsStoredInCache(boolean isStoredInCache)
isStoredInCache
- set this to true if you would like to store lock in the cache and set it to false if you would like to store it in the object.public void setWriteLockFieldName(java.lang.String writeLockFieldName)
writeLockFieldName
- the name of the field to lock against.public void storeInCache()
public void storeInObject()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |