org.hibernate
Enum FlushMode

java.lang.Object
  extended by java.lang.Enum<FlushMode>
      extended by org.hibernate.FlushMode
All Implemented Interfaces:
Serializable, Comparable<FlushMode>

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.

See Also:
Session.setFlushMode(FlushMode), Query.setFlushMode(FlushMode), Criteria.setFlushMode(FlushMode)

Enum Constant Summary
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 Transaction.commit() is called.
MANUAL
          The Session is only ever flushed when Session.flush() is explicitly called by the application.
NEVER
          Deprecated. use MANUAL instead.
 
Method Summary
static boolean isManualFlushMode(FlushMode mode)
           
 boolean lessThan(FlushMode other)
           
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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NEVER

public static final FlushMode NEVER
Deprecated. use MANUAL instead.
The Session is never flushed unless Session.flush() is explicitly called by the application. This mode is very efficient for read only transactions.


MANUAL

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.


COMMIT

public static final FlushMode COMMIT
The Session is flushed when Transaction.commit() is called.


AUTO

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.


ALWAYS

public static final FlushMode ALWAYS
The Session is flushed before every query. This is almost always unnecessary and inefficient.

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(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

lessThan

public boolean lessThan(FlushMode other)

isManualFlushMode

public static boolean isManualFlushMode(FlushMode mode)


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.