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.
Enum Constant and Description |
---|
ALWAYS
The
Session is flushed before every query. |
AUTO
The
Session is sometimes flushed before query execution
in order to ensure that queries never return stale state. |
COMMIT
The
Session is flushed when EntityTransaction.commit()
is called. |
MANUAL
The
Session is only ever flushed when Session.flush()
is explicitly called by the application. |
Modifier and Type | Method and Description |
---|---|
static FlushMode |
interpretExternalSetting(String externalName)
Interprets an external representation of the flush mode.
|
static boolean |
isManualFlushMode(FlushMode mode)
Deprecated.
Just use equality check against
MANUAL . Legacy from before this was an enum |
boolean |
lessThan(FlushMode other)
Checks to see if
this flush mode is less than the given flush mode. |
static FlushMode |
valueOf(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.
|
public static final FlushMode MANUAL
The Session
is only ever flushed when Session.flush()
is explicitly called by the application. This mode is very
efficient for read only transactions.
public static final FlushMode COMMIT
The Session
is flushed when EntityTransaction.commit()
is called.
public static final FlushMode AUTO
The Session
is sometimes flushed before query execution
in order to ensure that queries never return stale state. This
is the default flush mode.
public static FlushMode[] values()
for (FlushMode c : FlushMode.values()) System.out.println(c);
public static FlushMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean lessThan(FlushMode other)
Checks to see if this
flush mode is less than the given flush mode.
other
- THe flush mode value to be checked against this
true
indicates other
is less than this
; false
otherwise@Deprecated public static boolean isManualFlushMode(FlushMode mode)
MANUAL
. Legacy from before this was an enumChecks to see if the given mode is the same as MANUAL
.
mode
- The mode to checkpublic static FlushMode interpretExternalSetting(String externalName)
Interprets an external representation of the flush mode. null
is returned as null
, otherwise
valueOf(String)
is used with the upper-case version of the incoming value. An unknown,
non-null value results in a MappingException being thrown.
externalName
- The external representationMappingException
- Indicates an unrecognized external representationCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.