Package org.hibernate
Enum FlushMode
- java.lang.Object
-
- java.lang.Enum<FlushMode>
-
- org.hibernate.FlushMode
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALWAYS
TheSession
is flushed before every query.AUTO
TheSession
is sometimes flushed before query execution in order to ensure that queries never return stale state.COMMIT
TheSession
is flushed whenEntityTransaction.commit()
is called.MANUAL
TheSession
is only ever flushed whenSession.flush()
is explicitly called by the application.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static FlushMode
interpretExternalSetting(java.lang.String externalName)
Interprets an external representation of the flush mode.static boolean
isManualFlushMode(FlushMode mode)
Deprecated.Just use equality check againstMANUAL
.boolean
lessThan(FlushMode other)
Checks to see ifthis
flush mode is less than the given flush mode.static FlushMode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static FlushMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MANUAL
public static final FlushMode MANUAL
TheSession
is only ever flushed whenSession.flush()
is explicitly called by the application. This mode is very efficient for read only transactions.
-
COMMIT
public static final FlushMode COMMIT
TheSession
is flushed whenEntityTransaction.commit()
is called.
-
AUTO
public static final FlushMode AUTO
TheSession
is sometimes flushed before query execution in order to ensure that queries never return stale state. This is the default flush mode.
-
-
Method Detail
-
values
public static FlushMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FlushMode c : FlushMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FlushMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
lessThan
public boolean lessThan(FlushMode other)
Checks to see ifthis
flush mode is less than the given flush mode.- Parameters:
other
- THe flush mode value to be checked againstthis
- Returns:
true
indicatesother
is less thanthis
;false
otherwise
-
isManualFlushMode
@Deprecated public static boolean isManualFlushMode(FlushMode mode)
Deprecated.Just use equality check againstMANUAL
. Legacy from before this was an enumChecks to see if the given mode is the same asMANUAL
.- Parameters:
mode
- The mode to check- Returns:
- true/false
-
interpretExternalSetting
public static FlushMode interpretExternalSetting(java.lang.String externalName)
Interprets an external representation of the flush mode.null
is returned asnull
, otherwisevalueOf(String)
is used with the upper-case version of the incoming value. An unknown, non-null value results in a MappingException being thrown.- Parameters:
externalName
- The external representation- Returns:
- The interpreted FlushMode value.
- Throws:
MappingException
- Indicates an unrecognized external representation
-
-