Package org.hibernate.cache.spi
Interface CacheImplementor
-
- All Superinterfaces:
Cache,Cache,CacheImplementor,java.io.Serializable,Service
public interface CacheImplementor extends Service, Cache, CacheImplementor, java.io.Serializable
SPI contract for Hibernate's second-level cache engine- 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()Clean up the default query cachejava.util.Set<java.lang.String>getCacheRegionNames()The unqualified name of all regions.CollectionDataAccessgetCollectionRegionAccess(NavigableRole collectionRole)Deprecated.UseEntityPersister.getNaturalIdCacheAccessStrategy()()} insteaddefault QueryCachegetDefaultQueryCache()Deprecated.UsegetDefaultQueryResultsCache()instead.QueryResultsCachegetDefaultQueryResultsCache()Access to the "default" region used to store query results when caching was requested but no region was explicitly named.EntityDataAccessgetEntityRegionAccess(NavigableRole rootEntityName)Deprecated.UseEntityPersister.getCacheAccessStrategy()insteadjava.util.Set<NaturalIdDataAccess>getNaturalIdAccessesInRegion(java.lang.String legacyQualifiedRegionName)Deprecated.No replacement - added just for support of the newly deprecated methods expecting a qualified region nameNaturalIdDataAccessgetNaturalIdCacheRegionAccessStrategy(NavigableRole rootEntityName)Deprecated.UseEntityPersister.getNaturalIdCacheAccessStrategy()()} insteaddefault QueryCachegetQueryCache()Deprecated.UsegetDefaultQueryResultsCache()instead.default QueryCachegetQueryCache(java.lang.String regionName)Deprecated.UsegetQueryResultsCache(String)instead, but using unqualified nameQueryResultsCachegetQueryResultsCache(java.lang.String regionName)Get query cache by region name or create a new one if none exist.QueryResultsCachegetQueryResultsCacheStrictly(java.lang.String regionName)Get the named QueryResultRegionAccess but not creating one if it does not already exist.RegiongetRegion(java.lang.String regionName)Get a cache Region by name.default RegiongetRegionByLegacyName(java.lang.String legacyName)Deprecated.No replacement - added just for support of the newly deprecated methods expecting a qualified region nameRegionFactorygetRegionFactory()The underlying RegionFactory in use.java.lang.String[]getSecondLevelCacheRegionNames()Deprecated.(since 5.3) UsegetCacheRegionNames()insteadSessionFactoryImplementorgetSessionFactory()Access to the SessionFactory this Cache is bound to.TimestampsCachegetTimestampsCache()Find the cache data access strategy for Hibernate's timestamps cache.default UpdateTimestampsCachegetUpdateTimestampsCache()Deprecated.UsegetTimestampsCache()insteadvoidprime(java.util.Set<DomainDataRegionConfig> cacheRegionConfigs)An initialization phase allowing the caching provider to prime itself from the passed configsdefault java.lang.StringunqualifyRegionName(java.lang.String name)Deprecated.(since 5.3) No replacement - added just to continue some backwards compatibility in supporting the newly deprecated methods expecting a qualified (prefix +) region name-
Methods inherited from interface org.hibernate.Cache
containsCollection, containsEntity, containsEntity, containsQuery, evictAll, evictAllRegions, evictCollection, evictCollectionData, evictCollectionData, evictCollectionData, evictCollectionRegion, evictCollectionRegions, evictDefaultQueryRegion, evictEntity, evictEntity, evictEntityData, evictEntityData, evictEntityData, evictEntityData, evictEntityData, evictEntityRegion, evictEntityRegion, evictEntityRegions, evictNaturalIdData, evictNaturalIdData, evictNaturalIdData, evictNaturalIdRegion, evictNaturalIdRegion, evictNaturalIdRegions, evictQueryRegion, evictQueryRegions, evictRegion
-
-
-
-
Method Detail
-
getSessionFactory
SessionFactoryImplementor getSessionFactory()
Description copied from interface:CacheAccess to the SessionFactory this Cache is bound to.- Specified by:
getSessionFactoryin interfaceCache- Specified by:
getSessionFactoryin interfaceCacheImplementor- Returns:
- The SessionFactory
-
getRegionFactory
RegionFactory getRegionFactory()
The underlying RegionFactory in use.- Specified by:
getRegionFactoryin interfaceCacheImplementor
-
prime
void prime(java.util.Set<DomainDataRegionConfig> cacheRegionConfigs)
An initialization phase allowing the caching provider to prime itself from the passed configs- Specified by:
primein interfaceCacheImplementor- Since:
- 5.3
-
getRegion
Region getRegion(java.lang.String regionName)
Get a cache Region by name. If there is both aDomainDataRegionand aQueryResultsRegionwith the specified name, then theDomainDataRegionwill be returned.- Specified by:
getRegionin interfaceCacheImplementor- Since:
- 5.3
-
getCacheRegionNames
java.util.Set<java.lang.String> getCacheRegionNames()
The unqualified name of all regions. Intended for use withgetRegion(java.lang.String)- Specified by:
getCacheRegionNamesin interfaceCacheImplementor- 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- Specified by:
getTimestampsCachein interfaceCacheImplementor- 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- Specified by:
getDefaultQueryResultsCachein interfaceCacheImplementor
-
getQueryResultsCache
QueryResultsCache getQueryResultsCache(java.lang.String regionName)
Get query cache by region name or 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- Specified by:
getQueryResultsCachein interfaceCacheImplementor
-
getQueryResultsCacheStrictly
QueryResultsCache getQueryResultsCacheStrictly(java.lang.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- Specified by:
getQueryResultsCacheStrictlyin interfaceCacheImplementor- Since:
- 5.3
-
evictQueries
default void evictQueries() throws HibernateExceptionClean up the default query cache- Specified by:
evictQueriesin interfaceCacheImplementor- Throws:
HibernateException
-
close
void close()
Close this "cache", releasing all underlying resources.- Specified by:
closein interfaceCacheImplementor
-
getSecondLevelCacheRegionNames
@Deprecated java.lang.String[] getSecondLevelCacheRegionNames()
Deprecated.(since 5.3) UsegetCacheRegionNames()insteadGet the *qualified* names of all regions caching entity and collection data.- Specified by:
getSecondLevelCacheRegionNamesin interfaceCacheImplementor- Returns:
- All cache region names
-
getEntityRegionAccess
@Deprecated EntityDataAccess getEntityRegionAccess(NavigableRole rootEntityName)
Deprecated.UseEntityPersister.getCacheAccessStrategy()insteadFind the cache data access strategy for an entity. Will returnnullwhen the entity is not configured for caching.- Specified by:
getEntityRegionAccessin interfaceCacheImplementor- Parameters:
rootEntityName- The NavigableRole representation of the root entity
-
getNaturalIdCacheRegionAccessStrategy
@Deprecated NaturalIdDataAccess getNaturalIdCacheRegionAccessStrategy(NavigableRole rootEntityName)
Deprecated.UseEntityPersister.getNaturalIdCacheAccessStrategy()()} insteadFind 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.- Specified by:
getNaturalIdCacheRegionAccessStrategyin interfaceCacheImplementor- Parameters:
rootEntityName- The NavigableRole representation of the root entity
-
getCollectionRegionAccess
@Deprecated CollectionDataAccess getCollectionRegionAccess(NavigableRole collectionRole)
Deprecated.UseEntityPersister.getNaturalIdCacheAccessStrategy()()} insteadFind the cache data access strategy for the given collection. Will returnnullwhen the collection is not configured for caching.- Specified by:
getCollectionRegionAccessin interfaceCacheImplementor
-
getUpdateTimestampsCache
@Deprecated default UpdateTimestampsCache getUpdateTimestampsCache()
Deprecated.UsegetTimestampsCache()insteadGetUpdateTimestampsCacheinstance managed by theSessionFactory.- Specified by:
getUpdateTimestampsCachein interfaceCacheImplementor
-
getQueryCache
@Deprecated default QueryCache getQueryCache()
Deprecated.UsegetDefaultQueryResultsCache()instead.Get the defaultQueryCache.- Specified by:
getQueryCachein interfaceCacheImplementor
-
getDefaultQueryCache
@Deprecated default QueryCache getDefaultQueryCache()
Deprecated.UsegetDefaultQueryResultsCache()instead.Get the defaultQueryCache.- Specified by:
getDefaultQueryCachein interfaceCacheImplementor
-
getQueryCache
@Deprecated default QueryCache getQueryCache(java.lang.String regionName) throws HibernateException
Deprecated.UsegetQueryResultsCache(String)instead, but using unqualified name- Specified by:
getQueryCachein interfaceCacheImplementor- Throws:
HibernateException
-
unqualifyRegionName
@Deprecated default java.lang.String unqualifyRegionName(java.lang.String name)
Deprecated.(since 5.3) No replacement - added just to continue some backwards compatibility in supporting the newly deprecated methods expecting a qualified (prefix +) region name- Specified by:
unqualifyRegionNamein interfaceCacheImplementor
-
getRegionByLegacyName
@Deprecated default Region getRegionByLegacyName(java.lang.String legacyName)
Deprecated.No replacement - added just for support of the newly deprecated methods expecting a qualified region name- Specified by:
getRegionByLegacyNamein interfaceCacheImplementor
-
getNaturalIdAccessesInRegion
@Deprecated java.util.Set<NaturalIdDataAccess> getNaturalIdAccessesInRegion(java.lang.String legacyQualifiedRegionName)
Deprecated.No replacement - added just for support of the newly deprecated methods expecting a qualified region name- Specified by:
getNaturalIdAccessesInRegionin interfaceCacheImplementor
-
-