javax.persistence
Enum PessimisticLockScope

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

public enum PessimisticLockScope
extends Enum<PessimisticLockScope>

Defines the values of the javax.persistence.lock.scope property for pessimistic locking. This property may be passed as an argument to the methods of the EntityManager, Query, and TypedQuery interfaces that allow lock modes to be specified or used with the NamedQuery annotation.

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

Enum Constant Summary
EXTENDED
          In addition to the behavior for PessimisticLockScope.NORMAL, element collections and relationships owned by the entity that are contained in join tables will be locked if the javax.persistence.lock.scope property is specified with a value of PessimisticLockScope.EXTENDED.
NORMAL
          This value defines the default behavior for pessimistic locking.
 
Method Summary
static PessimisticLockScope valueOf(String name)
          Returns the enum constant of this type with the specified name.
static PessimisticLockScope[] 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

NORMAL

public static final PessimisticLockScope NORMAL
This value defines the default behavior for pessimistic locking.


EXTENDED

public static final PessimisticLockScope EXTENDED
In addition to the behavior for PessimisticLockScope.NORMAL, element collections and relationships owned by the entity that are contained in join tables will be locked if the javax.persistence.lock.scope property is specified with a value of PessimisticLockScope.EXTENDED.

Method Detail

values

public static PessimisticLockScope[] 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 (PessimisticLockScope c : PessimisticLockScope.values())
    System.out.println(c);

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

valueOf

public static PessimisticLockScope 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.