CacheModepublic final class CacheMode extends Object implements SerializableControls how the session interacts with the second-level
cache and query cache. |
Fields Summary |
---|
private final String | name | private final boolean | isPutEnabled | private final boolean | isGetEnabled | private static final Map | INSTANCES | public static final CacheMode | NORMALThe session may read items from the cache, and add items to the cache | public static final CacheMode | IGNOREThe session will never interact with the cache, except to invalidate
cache items when updates occur | public static final CacheMode | GETThe session may read items from the cache, but will not add items,
except to invalidate items when updates occur | public static final CacheMode | PUTThe 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 | REFRESHThe 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 boolean | isGetEnabled()
return isGetEnabled;
| public boolean | isPutEnabled()
return isPutEnabled;
| public static org.hibernate.CacheMode | parse(java.lang.String name)
return ( CacheMode ) INSTANCES.get( name );
| private java.lang.Object | readResolve()
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.String | toString()
return name;
|
|