Top Description Fields Constructors Methods
org.hibernate

public final Enum FlushMode

extends Enum<FlushMode>
Class Inheritance
Imports
org.hibernate.jpa.internal.util.FlushModeTypeHelper

Represents a flushing strategy. The flush process synchronizes database state with session state by detecting state changes and executing SQL statements.
Author
Gavin King
See Also
Session#setFlushMode(FlushMode), Query#setFlushMode(FlushMode), Criteria#setFlushMode(FlushMode)

Field Summary

Modifier and TypeField and Description
public static final FlushMode
ALWAYS

The Session is flushed before every query.

public static final FlushMode
AUTO

The Session is sometimes flushed before query execution in order to ensure that queries never return stale state.

public static final FlushMode
COMMIT

The Session is flushed when Transaction#commit is called.

private final int
public static final FlushMode
MANUAL

The Session is only ever flushed when Session#flush is explicitly called by the application.

Constructor Summary

AccessConstructor and Description
private
FlushMode(int level)

Method Summary

Modifier and TypeMethod and Description
public static FlushMode

Returns:

The interpreted FlushMode value.
interpretExternalSetting
(String
The external representation
externalName
)

Interprets an external representation of the flush mode.

public static boolean

Returns:

true/false
isManualFlushMode
(FlushMode
The mode to check
mode
)

Deprecated Just use equality check against MANUAL. Legacy from before this was an enum
Checks to see if the given mode is the same as MANUAL.
public boolean

Returns:

true indicates other is less than this; false otherwise
lessThan
(FlushMode
THe flush mode value to be checked against this
other
)

Checks to see if this flush mode is less than the given flush mode.

public static FlushMode
public static FlushMode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ALWAYSback to summary
public static final FlushMode ALWAYS

The Session is flushed before every query. This is almost always unnecessary and inefficient.

AUTOback to summary
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.

COMMITback to summary
public static final FlushMode COMMIT

The Session is flushed when Transaction#commit is called.

levelback to summary
private final int level
MANUALback to summary
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.

Constructor Detail

FlushModeback to summary
private FlushMode(int level)

Method Detail

interpretExternalSettingback to summary
public static FlushMode interpretExternalSetting(String externalName)

Interprets an external representation of the flush mode. null is returned as null, otherwise FlushMode#valueOf(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:String

The external representation

Returns:FlushMode

The interpreted FlushMode value.

Exceptions
MappingException:
Indicates an unrecognized external representation
isManualFlushModeback to summary
public static boolean isManualFlushMode(FlushMode mode)

Deprecated

Just use equality check against MANUAL. Legacy from before this was an enum

Checks to see if the given mode is the same as MANUAL.

Parameters
mode:FlushMode

The mode to check

Returns:boolean

true/false

Annotations
@Deprecated
lessThanback to summary
public boolean lessThan(FlushMode other)

Checks to see if this flush mode is less than the given flush mode.

Parameters
other:FlushMode

THe flush mode value to be checked against this

Returns:boolean

true indicates other is less than this; false otherwise

valueOfback to summary
public static FlushMode valueOf(String name)
valuesback to summary
public static FlushMode[] values()