Enum LockMode

java.lang.Object
java.lang.Enum<LockMode>
com.blazebit.persistence.view.LockMode
All Implemented Interfaces:
Serializable, Comparable<LockMode>, java.lang.constant.Constable

public enum LockMode
extends Enum<LockMode>
The lock mode types for updatable entity views.
Since:
1.2.0
Author:
Christian Beikov
  • Enum Constant Details

    • AUTO

      public static final LockMode AUTO
      The automatic lock mode will use optimistic locking if possible or no locking.
    • OPTIMISTIC

      public static final LockMode OPTIMISTIC
      The optimistic locking mode will use the version attribute of an entity to for optimistic locking.
    • PESSIMISTIC_READ

      public static final LockMode PESSIMISTIC_READ
      The pessimistic read locking mode will acquire a LockModeType.PESSIMISTIC_READ for the entity when reading the entity view. This lock mode is only useful within the bounds of a single transaction as the lock is bound to it.
    • PESSIMISTIC_WRITE

      public static final LockMode PESSIMISTIC_WRITE
      The pessimistic write locking mode will acquire a LockModeType.PESSIMISTIC_WRITE for the entity when reading the entity view. This lock mode is only useful within the bounds of a single transaction as the lock is bound to it.
    • NONE

      public static final LockMode NONE
      No locking at any point is done.
  • Method Details

    • values

      public static LockMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static LockMode 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