Package org.hibernate.cache.spi
Interface CacheImplementor
-
- All Superinterfaces:
Cache,Cache,Serializable,Service
- All Known Implementing Classes:
DisabledCaching,EnabledCaching
public interface CacheImplementor extends Service, Cache, Serializable
An SPI supported by any Hibernate service that provides an implementation of theCacheAPI. ExtendsCachewith operations called internally by Hibernate.- Since:
- 4.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidclose()Close this "cache", releasing all underlying resources.default voidevictQueries()Deprecated.only because it's currently never calledSet<String>getCacheRegionNames()The unqualified name of all regions.@Remove CollectionDataAccessgetCollectionRegionAccess(NavigableRole collectionRole)Find the cache data access strategy for the given collection.QueryResultsCachegetDefaultQueryResultsCache()Access to the "default" region used to store query results when caching was requested but no region was explicitly named.@Remove EntityDataAccessgetEntityRegionAccess(NavigableRole rootEntityName)Find the cache data access strategy for an entity.@Remove NaturalIdDataAccessgetNaturalIdCacheRegionAccessStrategy(NavigableRole rootEntityName)Find the cache data access strategy for the given entity's natural-id cache.QueryResultsCachegetQueryResultsCache(String regionName)Get query cache byregion nameor create a new one if none exist.QueryResultsCachegetQueryResultsCacheStrictly(String regionName)Get the named QueryResultRegionAccess but not creating one if it does not already exist.RegiongetRegion(String regionName)Get a cache Region by name.RegionFactorygetRegionFactory()The underlying RegionFactory in use.SessionFactoryImplementorgetSessionFactory()TheSessionFactoryto which thisCachebelongs.TimestampsCachegetTimestampsCache()Find the cache data access strategy for Hibernate's timestamps cache.voidprime(Set<DomainDataRegionConfig> cacheRegionConfigs)An initialization phase allowing the caching provider to prime itself from the passed configs-
Methods inherited from interface org.hibernate.Cache
containsCollection, containsEntity, containsEntity, containsQuery, evictAll, evictAllRegions, evictCollectionData, evictCollectionData, evictCollectionData, evictDefaultQueryRegion, evictEntityData, evictEntityData, evictEntityData, evictEntityData, evictEntityData, evictNaturalIdData, evictNaturalIdData, evictNaturalIdData, evictQueryRegion, evictQueryRegions, evictRegion
-
-
-
-
Method Detail
-
getSessionFactory
SessionFactoryImplementor getSessionFactory()
Description copied from interface:CacheTheSessionFactoryto which thisCachebelongs.- Specified by:
getSessionFactoryin interfaceCache- Returns:
- The SessionFactory
-
getRegionFactory
RegionFactory getRegionFactory()
The underlying RegionFactory in use.- API Note:
- CacheImplementor acts partially as a wrapper for details of interacting with the configured RegionFactory. Care should be taken when accessing the RegionFactory directly.
-
prime
void prime(Set<DomainDataRegionConfig> cacheRegionConfigs)
An initialization phase allowing the caching provider to prime itself from the passed configs- Since:
- 5.3
-
getRegion
Region getRegion(String regionName)
Get a cache Region by name. If there is both aDomainDataRegionand aQueryResultsRegionwith the specified name, then theDomainDataRegionwill be returned.- Since:
- 5.3
- API Note:
- It is only valid to call this method after
prime(java.util.Set<org.hibernate.cache.cfg.spi.DomainDataRegionConfig>)has been performed
-
getCacheRegionNames
Set<String> getCacheRegionNames()
The unqualified name of all regions. Intended for use withgetRegion(java.lang.String)- Since:
- 5.3
-
getTimestampsCache
TimestampsCache getTimestampsCache()
Find the cache data access strategy for Hibernate's timestamps cache. Will returnnullif Hibernate is not configured for query result caching- Since:
- 5.3
-
getDefaultQueryResultsCache
QueryResultsCache getDefaultQueryResultsCache()
Access to the "default" region used to store query results when caching was requested but no region was explicitly named. Will returnnullif Hibernate is not configured for query result caching
-
getQueryResultsCache
QueryResultsCache getQueryResultsCache(String regionName)
Get query cache byregion nameor create a new one if none exist. If the region name is null, then default query cache region will be returned. Will returnnullif Hibernate is not configured for query result caching
-
getQueryResultsCacheStrictly
QueryResultsCache getQueryResultsCacheStrictly(String regionName)
Get the named QueryResultRegionAccess but not creating one if it does not already exist. This is intended for use by statistics. Will returnnullif Hibernate is not configured for query result caching or if no such region (yet) exists- Since:
- 5.3
-
evictQueries
@Deprecated default void evictQueries() throws HibernateException
Deprecated.only because it's currently never calledClean up the default query cache- Throws:
HibernateException
-
close
void close()
Close this "cache", releasing all underlying resources.
-
getEntityRegionAccess
@Internal @Remove @Remove EntityDataAccess getEntityRegionAccess(NavigableRole rootEntityName)
Find the cache data access strategy for an entity. Will returnnullwhen the entity is not configured for caching.- Parameters:
rootEntityName- The NavigableRole representation of the root entity- API Note:
- Use
EntityPersister.getCacheAccessStrategy()instead - Implementation Specification:
- It is only valid to call this method after
prime(java.util.Set<org.hibernate.cache.cfg.spi.DomainDataRegionConfig>)has been performed
-
getNaturalIdCacheRegionAccessStrategy
@Internal @Remove @Remove NaturalIdDataAccess getNaturalIdCacheRegionAccessStrategy(NavigableRole rootEntityName)
Find the cache data access strategy for the given entity's natural-id cache. Will returnnullwhen the entity does not define a natural-id, or its natural-id is not configured for caching.- Parameters:
rootEntityName- The NavigableRole representation of the root entity- API Note:
- Use
EntityPersister.getNaturalIdCacheAccessStrategy()instead - Implementation Specification:
- It is only valid to call this method after
prime(java.util.Set<org.hibernate.cache.cfg.spi.DomainDataRegionConfig>)has been performed
-
getCollectionRegionAccess
@Internal @Remove @Remove CollectionDataAccess getCollectionRegionAccess(NavigableRole collectionRole)
Find the cache data access strategy for the given collection. Will returnnullwhen the collection is not configured for caching.- API Note:
- Use
EntityPersister.getNaturalIdCacheAccessStrategy()instead - Implementation Specification:
- It is only valid to call this method after
prime(java.util.Set<org.hibernate.cache.cfg.spi.DomainDataRegionConfig>)has been performed
-
-