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 theCache
API. ExtendsCache
with 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 void
close()
Close this "cache", releasing all underlying resources.default void
evictQueries()
Deprecated.only because it's currently never calledSet<String>
getCacheRegionNames()
The unqualified name of all regions.@Remove CollectionDataAccess
getCollectionRegionAccess(NavigableRole collectionRole)
Find the cache data access strategy for the given collection.QueryResultsCache
getDefaultQueryResultsCache()
Access to the "default" region used to store query results when caching was requested but no region was explicitly named.@Remove EntityDataAccess
getEntityRegionAccess(NavigableRole rootEntityName)
Find the cache data access strategy for an entity.@Remove NaturalIdDataAccess
getNaturalIdCacheRegionAccessStrategy(NavigableRole rootEntityName)
Find the cache data access strategy for the given entity's natural-id cache.QueryResultsCache
getQueryResultsCache(String regionName)
Get query cache byregion name
or create a new one if none exist.QueryResultsCache
getQueryResultsCacheStrictly(String regionName)
Get the named QueryResultRegionAccess but not creating one if it does not already exist.Region
getRegion(String regionName)
Get a cache Region by name.RegionFactory
getRegionFactory()
The underlying RegionFactory in use.SessionFactoryImplementor
getSessionFactory()
TheSessionFactory
to which thisCache
belongs.TimestampsCache
getTimestampsCache()
Find the cache data access strategy for Hibernate's timestamps cache.void
prime(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:Cache
TheSessionFactory
to which thisCache
belongs.- Specified by:
getSessionFactory
in 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 aDomainDataRegion
and aQueryResultsRegion
with the specified name, then theDomainDataRegion
will 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 returnnull
if 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 returnnull
if Hibernate is not configured for query result caching
-
getQueryResultsCache
QueryResultsCache getQueryResultsCache(String regionName)
Get query cache byregion name
or create a new one if none exist. If the region name is null, then default query cache region will be returned. Will returnnull
if 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 returnnull
if 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 returnnull
when 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 returnnull
when 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 returnnull
when 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
-
-