FileDocCategorySizeDatePackage
CacheMode.javaAPI DocHibernate 3.2.52364Wed Feb 01 12:59:08 GMT 2006org.hibernate

CacheMode

public final class CacheMode extends Object implements Serializable
Controls how the session interacts with the second-level cache and query cache.
see
Session#setCacheMode(CacheMode)
author
Gavin King

Fields Summary
private final String
name
private final boolean
isPutEnabled
private final boolean
isGetEnabled
private static final Map
INSTANCES
public static final CacheMode
NORMAL
The session may read items from the cache, and add items to the cache
public static final CacheMode
IGNORE
The session will never interact with the cache, except to invalidate cache items when updates occur
public static final CacheMode
GET
The session may read items from the cache, but will not add items, except to invalidate items when updates occur
public static final CacheMode
PUT
The session will never read items from the cache, but will add items to the cache as it reads them from the database.
public static final CacheMode
REFRESH
The session will never read items from the cache, but will add items to the cache as it reads them from the database. In this mode, the effect of hibernate.cache.use_minimal_puts is bypassed, in order to force a cache refresh
Constructors Summary
private CacheMode(String name, boolean isPutEnabled, boolean isGetEnabled)


	       
		this.name=name;
		this.isPutEnabled = isPutEnabled;
		this.isGetEnabled = isGetEnabled;
	
Methods Summary
public booleanisGetEnabled()

		return isGetEnabled;
	
public booleanisPutEnabled()

		return isPutEnabled;
	
public static org.hibernate.CacheModeparse(java.lang.String name)

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

	
	 
		INSTANCES.put( NORMAL.name, NORMAL );
		INSTANCES.put( IGNORE.name, IGNORE );
		INSTANCES.put( GET.name, GET );
		INSTANCES.put( PUT.name, PUT );
		INSTANCES.put( REFRESH.name, REFRESH );
	
		return INSTANCES.get( name );
	
public java.lang.StringtoString()

		return name;