public class CacheImpl extends Object implements CacheImplementor
| Constructor and Description | 
|---|
CacheImpl(SessionFactoryImplementor sessionFactory)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addCacheRegion(String name,
              Region region)
Add  
Region to this Cache scope. | 
void | 
close()
Close all cache regions. 
 | 
boolean | 
containsCollection(String role,
                  Serializable ownerIdentifier)
Determine whether the cache contains data for the given collection. 
 | 
boolean | 
containsEntity(Class entityClass,
              Serializable identifier)
Determine whether the cache contains data for the given entity "instance". 
 | 
boolean | 
containsEntity(String entityName,
              Serializable identifier)
Determine whether the cache contains data for the given entity "instance". 
 | 
boolean | 
containsQuery(String regionName)
Determine whether the cache contains data for the given query. 
 | 
void | 
evictAllRegions()
Evict all data from the cache. 
 | 
void | 
evictCollection(String role,
               Serializable ownerIdentifier)
Evicts the cache data for the given identified collection instance. 
 | 
void | 
evictCollectionRegion(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(Class entityClass,
           Serializable identifier)
Evicts the entity data for a particular entity "instance". 
 | 
void | 
evictEntity(String entityName,
           Serializable identifier)
Evicts the entity data for a particular entity "instance". 
 | 
void | 
evictEntityRegion(Class entityClass)
Evicts all entity data from the given region (i.e. 
 | 
void | 
evictEntityRegion(String entityName)
Evicts all entity data from the given region (i.e. 
 | 
void | 
evictEntityRegions()
Evict data from all entity regions. 
 | 
void | 
evictNaturalIdRegion(Class entityClass)
Evicts all naturalId data from the given region (i.e. 
 | 
void | 
evictNaturalIdRegion(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(String regionName)
Evicts all cached query results under the given name. 
 | 
void | 
evictQueryRegions()
Evict data from all query regions. 
 | 
Map<String,Region> | 
getAllSecondLevelCacheRegions()
Get all cache regions, including query cache. 
 | 
Region | 
getNaturalIdCacheRegion(String regionName)
Get natural id cache region by its name. 
 | 
QueryCache | 
getQueryCache()
Get the default  
QueryCache. | 
QueryCache | 
getQueryCache(String regionName)
Get query cache by region name or create a new one if none exist. 
 | 
RegionFactory | 
getRegionFactory()  | 
Region | 
getSecondLevelCacheRegion(String regionName)
Get second level cache region by its name. 
 | 
UpdateTimestampsCache | 
getUpdateTimestampsCache()
Get  
UpdateTimestampsCache instance managed by the SessionFactory. | 
public CacheImpl(SessionFactoryImplementor sessionFactory)
public boolean containsEntity(Class entityClass, Serializable identifier)
CachecontainsEntity in interface CacheentityClass - The entity class.identifier - The entity identifierpublic boolean containsEntity(String entityName, Serializable identifier)
CachecontainsEntity in interface CacheentityName - The entity name.identifier - The entity identifierpublic void evictEntity(Class entityClass, Serializable identifier)
CacheevictEntity in interface CacheentityClass - The entity class.identifier - The entity identifierpublic void evictEntity(String entityName, Serializable identifier)
CacheevictEntity in interface CacheentityName - The entity name.identifier - The entity identifierpublic void evictEntityRegion(Class entityClass)
CacheevictEntityRegion in interface CacheentityClass - The entity class.public void evictEntityRegion(String entityName)
CacheevictEntityRegion in interface CacheentityName - The entity name.public void evictEntityRegions()
CacheevictEntityRegions in interface Cachepublic void evictNaturalIdRegion(Class entityClass)
CacheevictNaturalIdRegion in interface CacheentityClass - The naturalId class.public void evictNaturalIdRegion(String entityName)
CacheevictNaturalIdRegion in interface CacheentityName - The naturalId name.public void evictNaturalIdRegions()
CacheevictNaturalIdRegions in interface Cachepublic boolean containsCollection(String role, Serializable ownerIdentifier)
CachecontainsCollection in interface 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(String role, Serializable ownerIdentifier)
CacheevictCollection in interface Cacherole - The "collection role" (in form [owner-entity-name].[collection-property-name]).ownerIdentifier - The identifier of the owning entitypublic void evictCollectionRegion(String role)
CacheevictCollectionRegion in interface Cacherole - The "collection role" (in form [owner-entity-name].[collection-property-name]).public void evictCollectionRegions()
CacheevictCollectionRegions in interface Cachepublic boolean containsQuery(String regionName)
CachecontainsQuery in interface CacheregionName - The cache name given to the query.public void evictDefaultQueryRegion()
CacheevictDefaultQueryRegion in interface Cachepublic void evictQueryRegion(String regionName)
CacheevictQueryRegion in interface CacheregionName - The cache name associated to the queries being cached.public void evictQueryRegions()
CacheevictQueryRegions in interface Cachepublic void close()
CacheImplementorclose in interface CacheImplementorpublic QueryCache getQueryCache()
CacheImplementorQueryCache.getQueryCache in interface CacheImplementorpublic QueryCache getQueryCache(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 void addCacheRegion(String name, Region region)
CacheImplementorRegion to this Cache scope.addCacheRegion in interface CacheImplementorname - The region name.region - The Region instance.public UpdateTimestampsCache getUpdateTimestampsCache()
CacheImplementorUpdateTimestampsCache instance managed by the SessionFactory.getUpdateTimestampsCache in interface CacheImplementorpublic void evictQueries()
                  throws HibernateException
CacheImplementorQueryCache.evictQueries in interface CacheImplementorHibernateExceptionpublic Region getSecondLevelCacheRegion(String regionName)
CacheImplementorgetSecondLevelCacheRegion in interface CacheImplementorregionName - The region name.public Region getNaturalIdCacheRegion(String regionName)
CacheImplementorgetNaturalIdCacheRegion in interface CacheImplementorregionName - The region name.public Map<String,Region> getAllSecondLevelCacheRegions()
CacheImplementorgetAllSecondLevelCacheRegions in interface CacheImplementorpublic RegionFactory getRegionFactory()
getRegionFactory in interface CacheImplementorRegionFactorypublic void evictAllRegions()
CacheevictAllRegions in interface CacheCopyright © 2001-2015 Red Hat, Inc. All Rights Reserved.