Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

B32476-02


oracle.toplink.descriptors
Class TimestampLockingPolicy

java.lang.Object
  extended by oracle.toplink.descriptors.VersionLockingPolicy
      extended by 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

Field Summary
static int LOCAL_TIME
           
static int SERVER_TIME
           

 

Fields inherited from class oracle.toplink.descriptors.VersionLockingPolicy
IN_CACHE, IN_OBJECT

 

Constructor Summary
TimestampLockingPolicy()
          Create a new TimestampLockingPolicy.
TimestampLockingPolicy(java.lang.String fieldName)
          Create a new TimestampLockingPolicy.

 

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 oracle.toplink.descriptors.VersionLockingPolicy
getWriteLockFieldName, isCascaded, isStoredInCache, isStoredInObject, setIsCascaded, setIsStoredInCache, setWriteLockField, setWriteLockFieldName, storeInCache, storeInObject

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

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

Constructor Detail

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.

Method Detail

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

Copyright © 1998, 2009, Oracle. All Rights Reserved.