Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle TopLink API Reference 10g Release 3 (10.1.3) B13698-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.toplink.descriptors
Class TimestampLockingPolicy

`java.lang.Object
oracle.toplink.descriptors.VersionLockingPolicy
oracle.toplink.descriptors.TimestampLockingPolicy`

All Implemented Interfaces:
  java.io.Serializable

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()` PUBLIC: Create a new TimestampLockingPolicy.
`TimestampLockingPolicy(java.lang.String fieldName)` PUBLIC: Create a new TimestampLockingPolicy.

Method Summary
`void` | `setUsesServerTime(boolean usesServerTime)` PUBLIC: Set if policy uses server time.
`void` | `useLocalTime()` PUBLIC: set this policy to get the time from the local machine.
`void` | `useServerTime()` PUBLIC: set this policy to get the time from the server.
`boolean` | `usesLocalTime()` PUBLIC: Return true if policy uses local time.
`boolean` | `usesServerTime()` PUBLIC: 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()

  PUBLIC: Create a new TimestampLockingPolicy. Defaults to using the time retrieved from the server.

### TimestampLockingPolicy

    public TimestampLockingPolicy(java.lang.String fieldName)

  PUBLIC: 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)

  PUBLIC: Set if policy uses server time.

### useLocalTime

    public void useLocalTime()

  PUBLIC: set this policy to get the time from the local machine.

### useServerTime

    public void useServerTime()

  PUBLIC: set this policy to get the time from the server.

### usesLocalTime

    public boolean usesLocalTime()

  PUBLIC: Return true if policy uses local time.

### usesServerTime

    public boolean usesServerTime()

  PUBLIC: Return true if policy uses server time.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 1998, 2006, Oracle. All Rights Reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD