Class DisabledCaching

java.lang.Object
org.hibernate.cache.internal.DisabledCaching
All Implemented Interfaces:
Cache, Serializable, Cache, CacheImplementor, Service

public class DisabledCaching extends Object implements CacheImplementor
A CacheImplementor service used when the second-level cache is disabled.
See Also:
  • Constructor Details

  • Method Details

    • getSessionFactory

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

      public RegionFactory getRegionFactory()
      Description copied from interface: CacheImplementor
      The underlying RegionFactory in use.
      Specified by:
      getRegionFactory in interface CacheImplementor
    • prime

      public void prime(Set<DomainDataRegionConfig> cacheRegionConfigs)
      Description copied from interface: CacheImplementor
      An initialization phase allowing the caching provider to prime itself from the passed configs
      Specified by:
      prime in interface CacheImplementor
    • containsEntity

      public boolean containsEntity(Class<?> entityClass, Object identifier)
      Description copied from interface: Cache
      Determine whether the cache contains an item for the entity of the given type, and with the given identifier.
      Specified by:
      containsEntity in interface Cache
      Parameters:
      entityClass - The entity type
      identifier - The entity identifier
      Returns:
      True if the underlying cache contains corresponding data; false otherwise.
    • containsEntity

      public boolean containsEntity(String entityName, Object identifier)
      Description copied from interface: Cache
      Determine whether the cache contains an item for the entity of the type with the given name, and with the given identifier.
      Specified by:
      containsEntity in interface Cache
      Parameters:
      entityName - The entity name
      identifier - The entity identifier
      Returns:
      True if the underlying cache contains corresponding data; false otherwise.
    • evictEntityData

      public void evictEntityData(Class<?> entityClass, Object identifier)
      Description copied from interface: Cache
      Evicts the cached item for the entity of the given type, and with the given identifier, if there is any such item in the cache.
      Specified by:
      evictEntityData in interface Cache
      Parameters:
      entityClass - The entity type
      identifier - The entity identifier
    • evictEntityData

      public void evictEntityData(String entityName, Object identifier)
      Description copied from interface: Cache
      Evict the cached item for the entity of the type with the given name, and with the given identifier, if there is any such item in the cache.
      Specified by:
      evictEntityData in interface Cache
      Parameters:
      entityName - The entity name
      identifier - The entity identifier
    • evictEntityData

      public void evictEntityData(Class<?> entityClass)
      Description copied from interface: Cache
      Evict all cached data from the cache region to which the given entity type is assigned. Thus, every cached item for the given entity type will be evicted, along with any cached items for any other entity type assigned to the same cache region.
      Specified by:
      evictEntityData in interface Cache
      Parameters:
      entityClass - The entity type
    • evictEntityData

      public void evictEntityData(String entityName)
      Description copied from interface: Cache
      Evict all cached data from the cache region to which the given named entity type is assigned. Thus, every cached item for the given entity type will be evicted, along with any cached items for any other entity type assigned to the same cache region.
      Specified by:
      evictEntityData in interface Cache
      Parameters:
      entityName - The entity name
    • evictEntityData

      public void evictEntityData()
      Description copied from interface: Cache
      Evict all cached data from every cache region to which any entity type is assigned.
      Specified by:
      evictEntityData in interface Cache
    • evictNaturalIdData

      public void evictNaturalIdData(Class<?> entityClass)
      Description copied from interface: Cache
      Evict all cached natural id mappings for the given entity type.
      Specified by:
      evictNaturalIdData in interface Cache
      Parameters:
      entityClass - The entity type
    • evictNaturalIdData

      public void evictNaturalIdData(String entityName)
      Description copied from interface: Cache
      Evict all cached natural id mappings for the entity type with the given name.
      Specified by:
      evictNaturalIdData in interface Cache
      Parameters:
      entityName - The entity name
    • evictNaturalIdData

      public void evictNaturalIdData()
      Description copied from interface: Cache
      Evict all cached natural id mappings for every entity type.
      Specified by:
      evictNaturalIdData in interface Cache
    • containsCollection

      public boolean containsCollection(String role, Object ownerIdentifier)
      Description copied from interface: Cache
      Determine whether the cache contains an item for the collection with the given role and given identifier.
      Specified by:
      containsCollection in interface Cache
      Parameters:
      role - The name of the collection role in the form package.OwnerEntityName.collectionPropertyName
      ownerIdentifier - The identifier of the owning entity
      Returns:
      True if the underlying cache contains corresponding data; false otherwise.
    • evictCollectionData

      public void evictCollectionData(String role, Object ownerIdentifier)
      Description copied from interface: Cache
      Evict the cached item for the collection with the given role and given identifier, if there is any such item in the cache.
      Specified by:
      evictCollectionData in interface Cache
      Parameters:
      role - The name of the collection role in the form package.OwnerEntityName.collectionPropertyName
      ownerIdentifier - The identifier of the owning entity
    • evictCollectionData

      public void evictCollectionData(String role)
      Description copied from interface: Cache
      Evict all cached data from the cache region to which the given collection role is assigned.
      Specified by:
      evictCollectionData in interface Cache
      Parameters:
      role - The name of the collection role in the form package.OwnerEntityName.collectionPropertyName
    • evictCollectionData

      public void evictCollectionData()
      Description copied from interface: Cache
      Evict all cache data from every cache region to which some collection role is assigned.
      Specified by:
      evictCollectionData in interface Cache
    • containsQuery

      public boolean containsQuery(String regionName)
      Description copied from interface: Cache
      Determine whether the given region name contains cached query results.
      Specified by:
      containsQuery in interface Cache
      Parameters:
      regionName - The name of a cache region to which some query is assigned
      Returns:
      True if the underlying cache contains corresponding data; false otherwise.
    • evictDefaultQueryRegion

      public void evictDefaultQueryRegion()
      Description copied from interface: Cache
      Evict all cached query results from the default region.
      Specified by:
      evictDefaultQueryRegion in interface Cache
    • evictQueryRegion

      public void evictQueryRegion(String regionName)
      Description copied from interface: Cache
      Evict all cached query results from the region with the given name.
      Specified by:
      evictQueryRegion in interface Cache
      Parameters:
      regionName - The cache name associated to the queries being cached.
    • evictQueryRegions

      public void evictQueryRegions()
      Description copied from interface: Cache
      Evict all cached query results from every region.
      Specified by:
      evictQueryRegions in interface Cache
    • evictRegion

      public void evictRegion(String regionName)
      Description copied from interface: Cache
      Evict all cached data from the named cache region.
      Specified by:
      evictRegion in interface Cache
    • getRegion

      public Region getRegion(String fullRegionName)
      Description copied from interface: CacheImplementor
      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.
      Specified by:
      getRegion in interface CacheImplementor
    • getTimestampsCache

      public TimestampsCache getTimestampsCache()
      Description copied from interface: CacheImplementor
      Find the cache data access strategy for Hibernate's timestamps cache. Will return null if Hibernate is not configured for query result caching
      Specified by:
      getTimestampsCache in interface CacheImplementor
    • getDefaultQueryResultsCache

      public QueryResultsCache getDefaultQueryResultsCache()
      Description copied from interface: CacheImplementor
      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
      Specified by:
      getDefaultQueryResultsCache in interface CacheImplementor
    • getQueryResultsCache

      public QueryResultsCache getQueryResultsCache(String regionName)
      Description copied from interface: CacheImplementor
      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
      Specified by:
      getQueryResultsCache in interface CacheImplementor
    • getQueryResultsCacheStrictly

      public QueryResultsCache getQueryResultsCacheStrictly(String regionName)
      Description copied from interface: CacheImplementor
      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
      Specified by:
      getQueryResultsCacheStrictly in interface CacheImplementor
    • close

      public void close()
      Description copied from interface: CacheImplementor
      Close this "cache", releasing all underlying resources.
      Specified by:
      close in interface CacheImplementor
    • getCacheRegionNames

      public Set<String> getCacheRegionNames()
      Description copied from interface: CacheImplementor
      The unqualified name of all regions. Intended for use with CacheImplementor.getRegion(java.lang.String)
      Specified by:
      getCacheRegionNames in interface CacheImplementor
    • getEntityRegionAccess

      @Deprecated public EntityDataAccess getEntityRegionAccess(NavigableRole rootEntityName)
      Deprecated.
      Description copied from interface: CacheImplementor
      Find the cache data access strategy for an entity. Will return null when the entity is not configured for caching.
      Specified by:
      getEntityRegionAccess in interface CacheImplementor
      Parameters:
      rootEntityName - The NavigableRole representation of the root entity
    • getNaturalIdCacheRegionAccessStrategy

      @Deprecated public NaturalIdDataAccess getNaturalIdCacheRegionAccessStrategy(NavigableRole rootEntityName)
      Deprecated.
      Description copied from interface: CacheImplementor
      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.
      Specified by:
      getNaturalIdCacheRegionAccessStrategy in interface CacheImplementor
      Parameters:
      rootEntityName - The NavigableRole representation of the root entity
    • getCollectionRegionAccess

      @Deprecated public CollectionDataAccess getCollectionRegionAccess(NavigableRole collectionRole)
      Deprecated.
      Description copied from interface: CacheImplementor
      Find the cache data access strategy for the given collection. Will return null when the collection is not configured for caching.
      Specified by:
      getCollectionRegionAccess in interface CacheImplementor
    • contains

      public boolean contains(Class cls, Object primaryKey)
      Specified by:
      contains in interface Cache
    • evict

      public void evict(Class cls, Object primaryKey)
      Specified by:
      evict in interface Cache
    • evict

      public void evict(Class cls)
      Specified by:
      evict in interface Cache
    • unwrap

      public <T> T unwrap(Class<T> cls)
      Specified by:
      unwrap in interface Cache