javax.persistence
Enum LockModeType

java.lang.Object
  extended by java.lang.Enum<LockModeType>
      extended by javax.persistence.LockModeType
All Implemented Interfaces:
Serializable, Comparable<LockModeType>

public enum LockModeType
extends Enum<LockModeType>

Lock modes available.

Since:
JPA 1.0 version.
Author:
Florent Benoit
See Also:
JPA 2.0 specification

Enum Constant Summary
NONE
          No lock.
OPTIMISTIC
          Optimistic lock.
OPTIMISTIC_FORCE_INCREMENT
          Optimistic lock, with version update.
PESSIMISTIC_FORCE_INCREMENT
          Pessimistic write lock, with version update.
PESSIMISTIC_READ
          Pessimistic read lock.
PESSIMISTIC_WRITE
          Pessimistic write lock.
READ
          Synonymous with OPTIMISTIC.
WRITE
          Synonymous with OPTIMISTIC_FORCE_INCREMENT.
 
Method Summary
static LockModeType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static LockModeType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

READ

public static final LockModeType READ
Synonymous with OPTIMISTIC.


WRITE

public static final LockModeType WRITE
Synonymous with OPTIMISTIC_FORCE_INCREMENT.


OPTIMISTIC

public static final LockModeType OPTIMISTIC
Optimistic lock.

Since:
JPA 2.0 version.

OPTIMISTIC_FORCE_INCREMENT

public static final LockModeType OPTIMISTIC_FORCE_INCREMENT
Optimistic lock, with version update.

Since:
JPA 2.0 version.

PESSIMISTIC_READ

public static final LockModeType PESSIMISTIC_READ
Pessimistic read lock.

Since:
JPA 2.0 version.

PESSIMISTIC_WRITE

public static final LockModeType PESSIMISTIC_WRITE
Pessimistic write lock.

Since:
JPA 2.0 version.

PESSIMISTIC_FORCE_INCREMENT

public static final LockModeType PESSIMISTIC_FORCE_INCREMENT
Pessimistic write lock, with version update.

Since:
JPA 2.0 version.

NONE

public static final LockModeType NONE
No lock.

Since:
JPA 2.0 version.
Method Detail

values

public static LockModeType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (LockModeType c : LockModeType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static LockModeType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2007-2012 OW2 Consortium. All Rights Reserved.