Interface CacheImplementor

All Superinterfaces:
Cache, Cache, Serializable, Service

public interface CacheImplementor extends Service, Cache, Serializable
An SPI supported by any Hibernate service that provides an implementation of the Cache API. Extends Cache with operations called internally by Hibernate.
Since:
4.1
  • Method Details

    • getSessionFactory

      SessionFactoryImplementor getSessionFactory()
      Description copied from interface: Cache
      The SessionFactory to which this Cache belongs.
      Specified by:
      getSessionFactory in interface Cache
      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 a DomainDataRegion and a QueryResultsRegion with the specified name, then the DomainDataRegion will be returned.
      Since:
      5.3
      API Note:
      It is only valid to call this method after prime(Set) has been performed
    • getCacheRegionNames

      Set<String> getCacheRegionNames()
      The unqualified name of all regions. Intended for use with getRegion(String)
      Since:
      5.3
    • getTimestampsCache

      TimestampsCache getTimestampsCache()
      Find the cache data access strategy for Hibernate's timestamps cache. Will return null 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 return null if Hibernate is not configured for query result caching
    • getQueryResultsCache

      QueryResultsCache getQueryResultsCache(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 return null 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 return null 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 called
      Clean up the default query cache
      Throws:
      HibernateException
    • close

      void close()
      Close this "cache", releasing all underlying resources.
    • getEntityRegionAccess

      @Internal @Remove EntityDataAccess getEntityRegionAccess(NavigableRole rootEntityName)
      Find the cache data access strategy for an entity. Will return null 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(Set) has been performed
    • getNaturalIdCacheRegionAccessStrategy

      @Internal @Remove NaturalIdDataAccess getNaturalIdCacheRegionAccessStrategy(NavigableRole rootEntityName)
      Find the cache data access strategy for the given entity's natural-id cache. Will return null 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(Set) has been performed
    • getCollectionRegionAccess

      @Internal @Remove CollectionDataAccess getCollectionRegionAccess(NavigableRole collectionRole)
      Find the cache data access strategy for the given collection. Will return null 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(Set) has been performed