javax.persistence

Enum LockModeType

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static LockModeType valueOf(java.lang.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. OPTIMISTIC is to be preferred for new applications.
      • WRITE

        public static final LockModeType WRITE
        Synonymous with OPTIMISTIC_FORCE_INCREMENT. OPTIMISTIC_FORCE_IMCREMENT is to be preferred for new applications.
      • OPTIMISTIC

        public static final LockModeType OPTIMISTIC
        Optimistic lock.
        Since:
        Java Persistence 2.0
      • OPTIMISTIC_FORCE_INCREMENT

        public static final LockModeType OPTIMISTIC_FORCE_INCREMENT
        Optimistic lock, with version update.
        Since:
        Java Persistence 2.0
      • PESSIMISTIC_READ

        public static final LockModeType PESSIMISTIC_READ
        Pessimistic read lock.
        Since:
        Java Persistence 2.0
      • PESSIMISTIC_WRITE

        public static final LockModeType PESSIMISTIC_WRITE
        Pessimistic write lock.
        Since:
        Java Persistence 2.0
      • PESSIMISTIC_FORCE_INCREMENT

        public static final LockModeType PESSIMISTIC_FORCE_INCREMENT
        Pessimistic write lock, with version update.
        Since:
        Java Persistence 2.0
      • NONE

        public static final LockModeType NONE
        No lock.
        Since:
        Java Persistence 2.0
    • 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(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null