public enum FlushMode extends Enum<FlushMode>
Session.setFlushMode(FlushMode)
,
Query.setFlushMode(FlushMode)
,
Criteria.setFlushMode(FlushMode)
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
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
Session
is flushed when EntityTransaction.commit()
is called.public static final FlushMode AUTO
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)
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 enumMANUAL
.mode
- The mode to checkpublic static FlushMode interpretExternalSetting(String externalName)
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 © 2019 JBoss by Red Hat. All rights reserved.