Package org.hibernate
Enum Class FlushMode
- All Implemented Interfaces:
Serializable,Comparable<FlushMode>,Constable
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 specifieswhen 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 beset at the session level, and competes with the JPA-defined enumerationFlushModeType. Alternatively, aQueryFlushMode may be specified for a given query.
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extendsEnum<E>>Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTheSessionis flushed whenEntityTransaction.commit()is called and before every query.TheSessionis flushed whenEntityTransaction.commit()is called, and is sometimes flushed before query execution in order to ensure that queries never return stale state.TheSessionis flushed whenEntityTransaction.commit()is called.TheSessionis only flushed whenSession.flush()is called explicitly.Method Summary
Modifier and TypeMethodDescriptionstaticFlushModefromJpaFlushMode(FlushModeType flushModeType) staticFlushModeinterpretExternalSetting(String externalName) Interprets an external representation of a flush mode.booleanCompare this flush mode to the given flush mode.staticFlushModeTypetoJpaFlushMode(FlushMode flushMode) staticFlushModeReturns the enum constant of this class with the specified name.staticFlushMode[]values()Returns an array containing the constants of this enum class, inthe order they are declared.
Enum Constant Details
MANUAL
TheSessionis only flushed whenSession.flush()is called explicitly. This mode is very efficient for read-only transactions.COMMIT
TheSessionis flushed whenEntityTransaction.commit()is called. It is never automatically flushed before query execution.- See Also:
AUTO
TheSessionis flushed whenEntityTransaction.commit()is called, and is sometimes flushed before query execution in order to ensure that queries never return stale state. This is the default flush mode.- See Also:
ALWAYS
TheSessionis flushed whenEntityTransaction.commit()is called and before every query. This is usually unnecessary and inefficient.
Method Details
values
Returns an array containing the constants of this enum class, inthe order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
valueOf
Returns the enum constant of this class with the specified name.The string must matchexactly an identifier used to declare anenum 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 nameNullPointerException- if the argument is null
lessThan
Compare this flush mode to the given flush mode.- Returns:
trueif this flush mode flushes less often than the given flush mode
interpretExternalSetting
Interprets an external representation of a flush mode.- Parameters:
externalName- the name of aFlushMode, or of aFlushModeType- Returns:
- a
FlushMode, or null if the argument was null - Throws:
MappingException- for an unrecognized external representation
fromJpaFlushMode
toJpaFlushMode
toJpaFlushMode