Skip navigation links
oracle.toplink.descriptors
Class TimestampLockingPolicy
java.lang.Object
oracle.toplink.descriptors.VersionLockingPolicy
oracle.toplink.descriptors.TimestampLockingPolicy
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, oracle.toplink.internal.descriptors.OptimisticLockingPolicy
-
public class TimestampLockingPolicy
- extends VersionLockingPolicy
Purpose: Used to allow a single version timestamp to be used for optimistic locking.
- Since:
- TOPLink/Java 2.0
- See Also:
- Serialized Form
Method Summary |
void |
setUsesServerTime(boolean usesServerTime)
Set if policy uses server time. |
void |
useLocalTime()
set this policy to get the time from the local machine. |
void |
useServerTime()
set this policy to get the time from the server. |
boolean |
usesLocalTime()
Return true if policy uses local time. |
boolean |
usesServerTime()
Return true if policy uses server time. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SERVER_TIME
public static final int SERVER_TIME
-
- See Also:
- Constant Field Values
LOCAL_TIME
public static final int LOCAL_TIME
-
- See Also:
- Constant Field Values
TimestampLockingPolicy
public TimestampLockingPolicy()
- Create a new TimestampLockingPolicy. Defaults to using the time retrieved from the server.
TimestampLockingPolicy
public TimestampLockingPolicy(java.lang.String fieldName)
- Create a new TimestampLockingPolicy. Defaults to using the time retrieved from the server.
- Parameters:
fieldName
- the field where the write lock value will be stored.
setUsesServerTime
public void setUsesServerTime(boolean usesServerTime)
- Set if policy uses server time.
useLocalTime
public void useLocalTime()
- set this policy to get the time from the local machine.
useServerTime
public void useServerTime()
- set this policy to get the time from the server.
usesLocalTime
public boolean usesLocalTime()
- Return true if policy uses local time.
usesServerTime
public boolean usesServerTime()
- Return true if policy uses server time.
Skip navigation links