|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) B32476-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.toplink.descriptors.VersionLockingPolicy
public class 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() Create a new VersionLockingPolicy. |
|
VersionLockingPolicy(DatabaseField field) Create a new VersionLockingPolicy. |
|
VersionLockingPolicy(java.lang.String fieldName) Create a new VersionLockingPolicy. |
Method Summary | |
---|---|
int |
getVersionDifference(java.lang.Object currentValue, java.lang.Object domainObject, java.util.Vector primaryKeys, oracle.toplink.internal.sessions.AbstractSession session) Return the number of versions different between these objects. |
java.lang.String |
getWriteLockFieldName() Return the field name of the field that stores the write lock value. |
boolean |
isCascaded() Return true if the policy uses cascade locking. |
boolean |
isStoredInCache() Return true if the lock value is stored in the cache. |
boolean |
isStoredInObject() Return true if the lock value is stored in the object. |
void |
setIsCascaded(boolean isCascaded) Set whether to use cascade locking on the policy. |
void |
setIsStoredInCache(boolean isStoredInCache) Set whether to store the lock in the cache or in the object. |
void |
setWriteLockField(DatabaseField writeLockField) ADVANCED: Set the write lock field. |
void |
setWriteLockFieldName(java.lang.String writeLockFieldName) Set the write lock field name. |
void |
storeInCache() Configure the version lock value to be stored in the cache. |
void |
storeInObject() 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(DatabaseField field)
field
- the write lock field.Method Detail |
---|
public int getVersionDifference(java.lang.Object currentValue, java.lang.Object domainObject, java.util.Vector primaryKeys, oracle.toplink.internal.sessions.AbstractSession 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 isCascaded()
isCascaded
in interface oracle.toplink.internal.descriptors.OptimisticLockingPolicy
public boolean isStoredInCache()
isStoredInCache
in interface oracle.toplink.internal.descriptors.OptimisticLockingPolicy
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 setIsCascaded(boolean isCascaded)
isCascaded
- set this to true if you would like cascade the locking and set it to false if you would like no cascade locking.public void setWriteLockField(DatabaseField writeLockField)
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 |