FileDocCategorySizeDatePackage
FlushMode.javaAPI DocHibernate 3.2.52507Fri Sep 08 07:23:08 BST 2006org.hibernate

FlushMode

public final class FlushMode extends Object implements Serializable
Represents a flushing strategy. The flush process synchronizes database state with session state by detecting state changes and executing SQL statements.
see
Session#setFlushMode(FlushMode)
see
Query#setFlushMode(FlushMode)
see
Criteria#setFlushMode(FlushMode)
author
Gavin King

Fields Summary
private static final Map
INSTANCES
private final int
level
private final String
name
public static final FlushMode
NEVER
The {@link Session} is never flushed unless {@link Session#flush} is explicitly called by the application. This mode is very efficient for read only transactions.
public static final FlushMode
MANUAL
The {@link Session} is only ever flushed when {@link Session#flush} is explicitly called by the application. This mode is very efficient for read only transactions.
public static final FlushMode
COMMIT
The {@link Session} is flushed when {@link Transaction#commit} is called.
public static final FlushMode
AUTO
The {@link 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 final FlushMode
ALWAYS
The {@link Session} is flushed before every query. This is almost always unnecessary and inefficient.
Constructors Summary
private FlushMode(int level, String name)


	     
		this.level = level;
		this.name = name;
	
Methods Summary
public static booleanisManualFlushMode(org.hibernate.FlushMode mode)

		INSTANCES.put( NEVER.name, NEVER );
		INSTANCES.put( MANUAL.name, MANUAL );
		INSTANCES.put( AUTO.name, AUTO );
		INSTANCES.put( ALWAYS.name, ALWAYS );
		INSTANCES.put( COMMIT.name, COMMIT );
	
		return MANUAL.level == mode.level;
	
public booleanlessThan(org.hibernate.FlushMode other)

	
	    
		return this.level<other.level;
	
public static org.hibernate.FlushModeparse(java.lang.String name)

		return ( FlushMode ) INSTANCES.get( name );
	
private java.lang.ObjectreadResolve()

		return INSTANCES.get( name );
	
public java.lang.StringtoString()

		return name;