Package org.hibernate

Enum Class Locking.FollowOn

java.lang.Object
java.lang.Enum<Locking.FollowOn>
org.hibernate.Locking.FollowOn
All Implemented Interfaces:
FindOption, LockOption, RefreshOption, Serializable, Comparable<Locking.FollowOn>, Constable
Enclosing interface:
Locking

public static enum Locking.FollowOn extends Enum<Locking.FollowOn> implements FindOption, LockOption, RefreshOption
In certain circumstances, Hibernate may need to acquire locks through the use of additional queries. For example, some databases may not allow locking rows for queries with a join or with pagination. In such cases, Hibernate will fall back to issuing additional queries to lock the matching rows. This option controls whether Hibernate is allowed to use this approach.
  • Enum Constant Details

    • ALLOW

      public static final Locking.FollowOn ALLOW
      Allow follow-on locking when necessary.
    • DISALLOW

      public static final Locking.FollowOn DISALLOW
      Disallow follow-on locking, throwing an exception instead.
    • IGNORE

      public static final Locking.FollowOn IGNORE
      Disallow follow-on locking, but ignoring the situation rather than throw an exception.
      See Also:
      API Note:
      This can lead to rows not being locked when they are expected to be.
    • FORCE

      public static final Locking.FollowOn FORCE
      Force the use of follow-on locking.
      API Note:
      This may lead to exceptions from the database.
  • Method Details

    • values

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

      public static Locking.FollowOn valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • interpret

      public static Locking.FollowOn interpret(String name)
    • asLegacyValue

      public Boolean asLegacyValue()
      Interprets the follow-on strategy into the legacy boolean values.
      Returns:
      true if FORCE; false if DISALLOW; null otherwise.
      See Also:
    • fromLegacyValue

      public static Locking.FollowOn fromLegacyValue(Boolean value)
      Given a legacy boolean value, interpret the follow-on strategy.
      Returns:
      FORCE if true; DISALLOW if false; ALLOW otherwise.
      See Also: