public class CacheImpl extends Object implements javax.persistence.Cache
Cache.| Constructor and Description |
|---|
CacheImpl(EntityManagerFactoryImpl emf,
javax.persistence.SharedCacheMode cacheMode) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Class<?> cls,
Object primaryKey) |
void |
evict(Class<?> clazz) |
void |
evict(Class<?> clazz,
Object primaryKey) |
void |
evictAll() |
CacheInstance |
get(ManagedId<?> id)
Returns the instance with the id
|
List<CacheReference[]> |
get(String sql,
Object[] parameters)
Returns the resultset for the query
|
javax.persistence.SharedCacheMode |
getCacheMode()
Returns the cache mode of the cache.
|
javax.persistence.CacheRetrieveMode |
getCacheRetrieveMode(EntityTypeImpl<?> type)
Returns the cache retrieve mode for the entity
|
javax.persistence.CacheStoreMode |
getCacheStoreMode(EntityTypeImpl<?> type)
Returns the cache store mode for the entity
|
CacheStats |
getStats()
Returns the global cache stats.
|
CacheStats |
getStats(Class<?> clazz)
Returns the stats for the class.
|
boolean |
isOn()
Returns if the cache is on.
|
void |
put(ManagedInstance<?> instance)
Puts the instance to cache.
|
void |
put(String sql,
Object[] parameters,
List<?> results)
Puts the query result to cache.
|
void |
setCacheRetrieveMode(javax.persistence.CacheRetrieveMode mode)
Sets the cache retrieve mode for the entity
|
void |
setCacheStoreMode(javax.persistence.CacheStoreMode mode)
Sets the cache store mode for the entity
|
<T> T |
unwrap(Class<T> cls) |
public CacheImpl(EntityManagerFactoryImpl emf, javax.persistence.SharedCacheMode cacheMode)
emf - the entity manager factorycacheMode - the cache modepublic boolean contains(Class<?> cls, Object primaryKey)
contains in interface javax.persistence.Cachepublic void evict(Class<?> clazz)
evict in interface javax.persistence.Cachepublic void evict(Class<?> clazz, Object primaryKey)
evict in interface javax.persistence.Cachepublic void evictAll()
evictAll in interface javax.persistence.Cachepublic CacheInstance get(ManagedId<?> id)
id - the managed id of the instancenullpublic List<CacheReference[]> get(String sql, Object[] parameters)
sql - the sqlparameters - the parameterspublic javax.persistence.SharedCacheMode getCacheMode()
public javax.persistence.CacheRetrieveMode getCacheRetrieveMode(EntityTypeImpl<?> type)
type - the typepublic javax.persistence.CacheStoreMode getCacheStoreMode(EntityTypeImpl<?> type)
type - the typepublic CacheStats getStats()
public CacheStats getStats(Class<?> clazz)
clazz - the classpublic boolean isOn()
public void put(ManagedInstance<?> instance)
instance - the instance to putpublic void put(String sql, Object[] parameters, List<?> results)
sql - the sqlparameters - the parametersresults - the resultspublic void setCacheRetrieveMode(javax.persistence.CacheRetrieveMode mode)
mode - the mode or null to setpublic void setCacheStoreMode(javax.persistence.CacheStoreMode mode)
mode - the mode or null to setpublic <T> T unwrap(Class<T> cls)
unwrap in interface javax.persistence.CacheCopyright © 2012 Batoo Software & Consultancy. All Rights Reserved.