Package org.hibernate

Enum Class SessionCheckMode

java.lang.Object
java.lang.Enum<SessionCheckMode>
org.hibernate.SessionCheckMode
All Implemented Interfaces:
FindOption, Serializable, Comparable<SessionCheckMode>, Constable, FindMultipleOption

@Incubating public enum SessionCheckMode extends Enum<SessionCheckMode> implements FindMultipleOption
Indicates whether the persistence context should be checked for entities matching the identifiers to be loaded -
  • Entities which are in a managed state are not re-loaded from the database. those identifiers are removed from the SQL restriction sent to the database.
  • Entities which are in a removed state are excluded from the result by default, but can be included if desired.

The default is DISABLED

Since:
7.2
See Also:
  • Enum Constant Details

    • ENABLED

      public static final SessionCheckMode ENABLED
      The persistence context will be checked. Identifiers for entities already contained in the persistence context will not be sent to the database for loading. If the entity is marked for removal in the persistence context, whether it is returned is controlled by RemovalsMode.
      See Also:
    • DISABLED

      public static final SessionCheckMode DISABLED
      The default. All identifiers to be loaded will be read from the database and returned.
  • Method Details

    • values

      public static SessionCheckMode[] 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 SessionCheckMode 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