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

      @Nonnull SessionFactoryImplementor getSessionFactory()
      Description copied from interface: Cache
      The SessionFactory to which this Cache belongs.
      Specified by:
      getSessionFactory in interface Cache
    • getRegionFactory

      @Nonnull 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

      @Remove void prime(@Nonnull Set<DomainDataRegionConfig> cacheRegionConfigs)
      An initialization phase allowing the caching provider to prime itself from the passed configurations.
      Since:
      5.3
    • getRegion

      @Nullable Region getRegion(@Nonnull 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 illegal to call this method before prime(Set) has been called.
    • getCacheRegionNames

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

      @Nullable TimestampsCache getTimestampsCache()
      The cache data access strategy for the timestamp cache, or return null if Hibernate is not configured for query result caching.
      Since:
      5.3
    • getDefaultQueryResultsCache

      @Nullable QueryResultsCache getDefaultQueryResultsCache()
      Access to the "default" region used to store query results when caching is requested, but no region was explicitly named, or return null if Hibernate is not configured for query result caching.
    • getQueryResultsCache

      @Nullable QueryResultsCache getQueryResultsCache(@Nullable String regionName)
      Get the named region of the query results cache, creating it if it does not already exist. If the given region name is null, the default query cache region is returned. Return null if Hibernate is not configured for query result caching.
    • getQueryResultsCacheStrictly

      @Nullable QueryResultsCache getQueryResultsCacheStrictly(@Nullable String regionName)
      Get the named region of the query cache, but without creating it if it does not already exist, or return null if Hibernate is not configured for query result caching or if no such region (yet) exists.
      Since:
      5.3
      API Note:
      This is intended for use by statistics.
    • evictQueries

      @Deprecated default void evictQueries() throws HibernateException
      Deprecated.
      only because it's currently never called
      Clean up the default query results cache.
      Throws:
      HibernateException
    • close

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

      @Internal @Remove @Nullable EntityDataAccess getEntityRegionAccess(@Nonnull NavigableRole rootEntityName)
      Find the cache data access strategy for an entity, or return null if the given 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 illegal to call this method before prime(Set) has been called.
    • getNaturalIdCacheRegionAccessStrategy

      @Internal @Remove @Nullable NaturalIdDataAccess getNaturalIdCacheRegionAccessStrategy(@Nonnull NavigableRole rootEntityName)
      Find the cache data access strategy for the given entity's natural id cache, or 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 illegal to call this method before prime(Set) has been called.
    • getCollectionRegionAccess

      @Internal @Remove @Nullable CollectionDataAccess getCollectionRegionAccess(@Nonnull NavigableRole collectionRole)
      Find the cache data access strategy for the given collection, or return null when the collection is not configured for caching.
      API Note:
      Use EntityPersister.getNaturalIdCacheAccessStrategy() instead
      Implementation Specification:
      It is illegal to call this method before prime(Set) has been called.