Top Description Fields Constructors Methods
org.hibernate

public final Class CacheMode

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, java.util.HashMap, .Map

Controls how the session interacts with the second-level cache and query cache.
Author
Gavin King
See Also
Session#setCacheMode(CacheMode)

Field Summary

Modifier and TypeField and Description
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
IGNORE

The session will never interact with the cache, except to invalidate cache items when updates occur

private static final Map<K, V>
private final boolean
private final boolean
private final String
public static final CacheMode
NORMAL

The session may read items from the cache, and add items to the cache

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.

Constructor Summary

AccessConstructor and Description
private
CacheMode(String name, boolean isPutEnabled, boolean isGetEnabled)

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
public static CacheMode
parse(String name)

private Object
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

GETback to summary
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

IGNOREback to summary
public static final CacheMode IGNORE

The session will never interact with the cache, except to invalidate cache items when updates occur

INSTANCESback to summary
private static final Map<K, V> INSTANCES
isGetEnabledback to summary
private final boolean isGetEnabled
isPutEnabledback to summary
private final boolean isPutEnabled
nameback to summary
private final String name
NORMALback to summary
public static final CacheMode NORMAL

The session may read items from the cache, and add items to the cache

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

REFRESHback to summary
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

Constructor Detail

CacheModeback to summary
private CacheMode(String name, boolean isPutEnabled, boolean isGetEnabled)

Method Detail

isGetEnabledback to summary
public boolean isGetEnabled()
isPutEnabledback to summary
public boolean isPutEnabled()
parseback to summary
public static CacheMode parse(String name)
readResolveback to summary
private Object readResolve()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.