public class CacheImpl extends java.lang.Object implements CacheImplementor
| Constructor and Description |
|---|
CacheImpl(SessionFactoryImplementor sessionFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close all cache regions.
|
boolean |
contains(java.lang.Class cls,
java.lang.Object primaryKey) |
boolean |
containsCollection(java.lang.String role,
java.io.Serializable ownerIdentifier)
Determine whether the cache contains data for the given collection.
|
boolean |
containsEntity(java.lang.Class entityClass,
java.io.Serializable identifier)
Determine whether the cache contains data for the given entity "instance".
|
boolean |
containsEntity(java.lang.String entityName,
java.io.Serializable identifier)
Determine whether the cache contains data for the given entity "instance".
|
boolean |
containsQuery(java.lang.String regionName)
Determine whether the cache contains data for the given query.
|
CollectionRegionAccessStrategy |
determineCollectionRegionAccessStrategy(Collection model) |
EntityRegionAccessStrategy |
determineEntityRegionAccessStrategy(PersistentClass model) |
NaturalIdRegionAccessStrategy |
determineNaturalIdRegionAccessStrategy(PersistentClass model) |
void |
evict(java.lang.Class cls) |
void |
evict(java.lang.Class cls,
java.lang.Object primaryKey) |
void |
evictAll() |
void |
evictAllRegions()
Evict all data from the cache.
|
void |
evictCollection(java.lang.String role,
java.io.Serializable ownerIdentifier)
Evicts the cache data for the given identified collection instance.
|
void |
evictCollectionRegion(java.lang.String role)
Evicts all entity data from the given region (i.e.
|
void |
evictCollectionRegions()
Evict data from all collection regions.
|
void |
evictDefaultQueryRegion()
Evicts all cached query results from the default region.
|
void |
evictEntity(java.lang.Class entityClass,
java.io.Serializable identifier)
Evicts the entity data for a particular entity "instance".
|
void |
evictEntity(java.lang.String entityName,
java.io.Serializable identifier)
Evicts the entity data for a particular entity "instance".
|
void |
evictEntityRegion(java.lang.Class entityClass)
Evicts all entity data from the given region (i.e.
|
void |
evictEntityRegion(java.lang.String entityName)
Evicts all entity data from the given region (i.e.
|
void |
evictEntityRegions()
Evict data from all entity regions.
|
void |
evictNaturalIdRegion(java.lang.Class entityClass)
Evicts all naturalId data from the given region (i.e.
|
void |
evictNaturalIdRegion(java.lang.String entityName)
Evicts all naturalId data from the given region (i.e.
|
void |
evictNaturalIdRegions()
Evict data from all naturalId regions.
|
void |
evictQueries()
Clean up the default
QueryCache. |
void |
evictQueryRegion(java.lang.String regionName)
Evicts all cached query results under the given name.
|
void |
evictQueryRegions()
Evict data from all query regions.
|
CollectionRegionAccessStrategy |
getCollectionRegionAccess(java.lang.String regionName)
Find the "access strategy" for the named collection cache region.
|
QueryCache |
getDefaultQueryCache()
Get the default
QueryCache. |
EntityRegionAccessStrategy |
getEntityRegionAccess(java.lang.String regionName)
Find the "access strategy" for the named entity cache region.
|
NaturalIdRegionAccessStrategy |
getNaturalIdCacheRegionAccessStrategy(java.lang.String regionName)
Find the "access strategy" for the named natrual-id cache region.
|
QueryCache |
getQueryCache(java.lang.String regionName)
Get query cache by region name or create a new one if none exist.
|
RegionFactory |
getRegionFactory()
The underlying RegionFactory in use.
|
java.lang.String[] |
getSecondLevelCacheRegionNames()
Get the names of all cache regions, including entity, collection, natural-id and query caches.
|
SessionFactory |
getSessionFactory()
Access to the SessionFactory this Cache is bound to.
|
UpdateTimestampsCache |
getUpdateTimestampsCache()
Get
UpdateTimestampsCache instance managed by the SessionFactory. |
java.lang.String |
qualifyRegionName(java.lang.String regionName)
Applies any defined prefix, handling all
null checks. |
<T> T |
unwrap(java.lang.Class<T> cls) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetQueryCachepublic CacheImpl(SessionFactoryImplementor sessionFactory)
public SessionFactory getSessionFactory()
Cachepublic RegionFactory getRegionFactory()
CacheImplementorgetRegionFactory in interface CacheImplementorRegionFactorypublic java.lang.String qualifyRegionName(java.lang.String regionName)
CacheImplementornull checks.qualifyRegionName in interface CacheImplementorregionName - The region name to qualifypublic boolean containsEntity(java.lang.Class entityClass,
java.io.Serializable identifier)
CacheentityClass - The entity class.identifier - The entity identifierpublic boolean containsEntity(java.lang.String entityName,
java.io.Serializable identifier)
CacheentityName - The entity name.identifier - The entity identifierpublic void evictEntity(java.lang.Class entityClass,
java.io.Serializable identifier)
CacheentityClass - The entity class.identifier - The entity identifierpublic void evictEntity(java.lang.String entityName,
java.io.Serializable identifier)
CacheentityName - The entity name.identifier - The entity identifierpublic void evictEntityRegion(java.lang.Class entityClass)
CacheentityClass - The entity class.public void evictEntityRegion(java.lang.String entityName)
CacheentityName - The entity name.public void evictEntityRegions()
Cachepublic void evictNaturalIdRegion(java.lang.Class entityClass)
CacheentityClass - The naturalId class.public void evictNaturalIdRegion(java.lang.String entityName)
CacheentityName - The naturalId name.public void evictNaturalIdRegions()
Cachepublic boolean containsCollection(java.lang.String role,
java.io.Serializable ownerIdentifier)
Cacherole - The name of the collection role (in form
[owner-entity-name].[collection-property-name]) whose regions should be
evicted.ownerIdentifier - The identifier of the owning entitypublic void evictCollection(java.lang.String role,
java.io.Serializable ownerIdentifier)
Cacherole - The "collection role" (in form [owner-entity-name].[collection-property-name]).ownerIdentifier - The identifier of the owning entitypublic void evictCollectionRegion(java.lang.String role)
Cacherole - The "collection role" (in form [owner-entity-name].[collection-property-name]).public void evictCollectionRegions()
Cachepublic boolean containsQuery(java.lang.String regionName)
CacheregionName - The cache name given to the query.public void evictDefaultQueryRegion()
Cachepublic void evictQueryRegion(java.lang.String regionName)
CacheregionName - The cache name associated to the queries being cached.public void evictQueryRegions()
Cachepublic void close()
CacheImplementorclose in interface CacheImplementorpublic QueryCache getDefaultQueryCache()
CacheImplementorQueryCache.getDefaultQueryCache in interface CacheImplementorpublic QueryCache getQueryCache(java.lang.String regionName) throws HibernateException
CacheImplementorgetQueryCache in interface CacheImplementorregionName - Query cache region name.QueryCache associated with the region name, or default query cache if the region name is null.HibernateException - HibernateException maybe thrown when the creation of new QueryCache instance.public UpdateTimestampsCache getUpdateTimestampsCache()
CacheImplementorUpdateTimestampsCache instance managed by the SessionFactory.getUpdateTimestampsCache in interface CacheImplementorpublic void evictQueries()
throws HibernateException
CacheImplementorQueryCache.evictQueries in interface CacheImplementorHibernateExceptionpublic java.lang.String[] getSecondLevelCacheRegionNames()
CacheImplementorgetSecondLevelCacheRegionNames in interface CacheImplementorpublic EntityRegionAccessStrategy getEntityRegionAccess(java.lang.String regionName)
CacheImplementorgetEntityRegionAccess in interface CacheImplementorregionName - The name of the regionpublic CollectionRegionAccessStrategy getCollectionRegionAccess(java.lang.String regionName)
CacheImplementorgetCollectionRegionAccess in interface CacheImplementorregionName - The name of the regionpublic NaturalIdRegionAccessStrategy getNaturalIdCacheRegionAccessStrategy(java.lang.String regionName)
CacheImplementorgetNaturalIdCacheRegionAccessStrategy in interface CacheImplementorregionName - The name of the regionpublic void evictAllRegions()
Cachepublic boolean contains(java.lang.Class cls,
java.lang.Object primaryKey)
contains in interface javax.persistence.Cachepublic void evict(java.lang.Class cls,
java.lang.Object primaryKey)
evict in interface javax.persistence.Cachepublic void evict(java.lang.Class cls)
evict in interface javax.persistence.Cachepublic void evictAll()
evictAll in interface javax.persistence.Cachepublic <T> T unwrap(java.lang.Class<T> cls)
unwrap in interface javax.persistence.Cachepublic EntityRegionAccessStrategy determineEntityRegionAccessStrategy(PersistentClass model)
determineEntityRegionAccessStrategy in interface CacheImplementorpublic NaturalIdRegionAccessStrategy determineNaturalIdRegionAccessStrategy(PersistentClass model)
determineNaturalIdRegionAccessStrategy in interface CacheImplementorpublic CollectionRegionAccessStrategy determineCollectionRegionAccessStrategy(Collection model)
determineCollectionRegionAccessStrategy in interface CacheImplementorCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.