Package org.hibernate

Enum Class FlushMode

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

public enum FlushMode extends Enum<FlushMode>
Represents a flushing strategy. The flush process synchronizes database state with session state by detecting state changes and executing SQL statements. A value of this enumeration specifies when the flush process occurs.

For example, COMMIT specifies that the session flushes automatically when the transaction is about to commit.

This enumeration represents options which may be set at the session level, and competes with the JPA-defined enumeration FlushModeType. Alternatively, a QueryFlushMode may be specified for a given query.

See Also:
  • Enum Constant Details

  • Method Details

    • values

      public static FlushMode[] 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 FlushMode 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
    • lessThan

      public boolean lessThan(FlushMode other)
      Compare this flush mode to the given flush mode.
      Returns:
      true if this flush mode flushes less often than the given flush mode
    • interpretExternalSetting

      public static FlushMode interpretExternalSetting(String externalName)
      Interprets an external representation of a flush mode.
      Parameters:
      externalName - the name of a FlushMode, or of a FlushModeType
      Returns:
      a FlushMode, or null if the argument was null
      Throws:
      MappingException - for an unrecognized external representation
    • fromJpaFlushMode

      public static FlushMode fromJpaFlushMode(FlushModeType flushModeType)
    • toJpaFlushMode

      public static FlushModeType toJpaFlushMode(FlushMode flushMode)
    • toJpaFlushMode

      public FlushModeType toJpaFlushMode()