Package org.hibernate

Enum Class ReadOnlyMode

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

public enum ReadOnlyMode extends Enum<ReadOnlyMode> implements FindOption
A FindOption which requests that entities be loaded in READ_ONLY mode or in regular READ_WRITE mode.
Since:
7.0
See Also:
  • Enum Constant Details

    • READ_ONLY

      public static final ReadOnlyMode READ_ONLY
      Specifies that an entity should be loaded in read-only mode.

      Read-only entities are not dirty-checked and snapshots of persistent state are not maintained. Read-only entities can be modified, but changes are not persisted.

    • READ_WRITE

      public static final ReadOnlyMode READ_WRITE
      Specifies that an entity should be loaded in the default modifiable mode, regardless of the default mode of the session.
  • Method Details

    • values

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