Package org.hibernate.cache.internal
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
ACacheImplementorservice used when the second-level cache is disabled.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DisabledCaching(SessionFactoryImplementor sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Close this "cache", releasing all underlying resources.booleancontains(Class cls, Object primaryKey)booleancontainsCollection(String role, Object ownerIdentifier)Determine whether the cache contains an item for the collection with the given role and given identifier.booleancontainsEntity(Class<?> entityClass, Object identifier)Determine whether the cache contains an item for the entity of the given type, and with the given identifier.booleancontainsEntity(String entityName, Object identifier)Determine whether the cache contains an item for the entity of the type with the given name, and with the given identifier.booleancontainsQuery(String regionName)Determine whether the given region name contains cached query results.voidevict(Class cls)voidevict(Class cls, Object primaryKey)voidevictCollectionData()Evict all cache data from every cache region to which some collection role is assigned.voidevictCollectionData(String role)Evict all cached data from the cache region to which the given collection role is assigned.voidevictCollectionData(String role, Object ownerIdentifier)Evict the cached item for the collection with the given role and given identifier, if there is any such item in the cache.voidevictDefaultQueryRegion()Evict all cached query results from the default region.voidevictEntityData()Evict all cached data from every cache region to which any entity type is assigned.voidevictEntityData(Class<?> entityClass)Evict all cached data from the cache region to which the given entity type is assigned.voidevictEntityData(Class<?> entityClass, Object identifier)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.voidevictEntityData(String entityName)Evict all cached data from the cache region to which the given named entity type is assigned.voidevictEntityData(String entityName, Object identifier)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.voidevictNaturalIdData()Evict all cached natural id mappings for every entity type.voidevictNaturalIdData(Class<?> entityClass)Evict all cached natural id mappings for the given entity type.voidevictNaturalIdData(String entityName)Evict all cached natural id mappings for the entity type with the given name.voidevictQueryRegion(String regionName)Evict all cached query results from the region with the given name.voidevictQueryRegions()Evict all cached query results from every region.voidevictRegion(String regionName)Evict all cached data from the named cache region.Set<String>getCacheRegionNames()The unqualified name of all regions.CollectionDataAccessgetCollectionRegionAccess(NavigableRole collectionRole)Deprecated.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.NaturalIdDataAccessgetNaturalIdCacheRegionAccessStrategy(NavigableRole rootEntityName)Deprecated.QueryResultsCachegetQueryResultsCache(String regionName)Get query cache byregion nameor create a new one if none exist.QueryResultsCachegetQueryResultsCacheStrictly(String regionName)Get the named QueryResultRegionAccess but not creating one if it does not already exist.RegiongetRegion(String fullRegionName)Get a cache Region by name.RegionFactorygetRegionFactory()The underlying RegionFactory in use.SessionFactoryImplementorgetSessionFactory()TheSessionFactoryto which thisCachebelongs.TimestampsCachegetTimestampsCache()Find the cache data access strategy for Hibernate's timestamps cache.voidprime(Set<DomainDataRegionConfig> cacheRegionConfigs)An initialization phase allowing the caching provider to prime itself from the passed configs<T> Tunwrap(Class<T> cls)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.Cache
evictAll, evictAllRegions
-
Methods inherited from interface org.hibernate.cache.spi.CacheImplementor
evictQueries
-
-
-
-
Constructor Detail
-
DisabledCaching
public DisabledCaching(SessionFactoryImplementor sessionFactory)
-
-
Method Detail
-
getSessionFactory
public SessionFactoryImplementor getSessionFactory()
Description copied from interface:CacheTheSessionFactoryto which thisCachebelongs.- Specified by:
getSessionFactoryin interfaceCache- Specified by:
getSessionFactoryin interfaceCacheImplementor- Returns:
- The SessionFactory
-
getRegionFactory
public RegionFactory getRegionFactory()
Description copied from interface:CacheImplementorThe underlying RegionFactory in use.- Specified by:
getRegionFactoryin interfaceCacheImplementor
-
prime
public void prime(Set<DomainDataRegionConfig> cacheRegionConfigs)
Description copied from interface:CacheImplementorAn initialization phase allowing the caching provider to prime itself from the passed configs- Specified by:
primein interfaceCacheImplementor
-
containsEntity
public boolean containsEntity(Class<?> entityClass, Object identifier)
Description copied from interface:CacheDetermine whether the cache contains an item for the entity of the given type, and with the given identifier.- Specified by:
containsEntityin interfaceCache- Parameters:
entityClass- The entity typeidentifier- 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:CacheDetermine whether the cache contains an item for the entity of the type with the given name, and with the given identifier.- Specified by:
containsEntityin interfaceCache- Parameters:
entityName- The entity nameidentifier- 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:CacheEvicts 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:
evictEntityDatain interfaceCache- Parameters:
entityClass- The entity typeidentifier- The entity identifier
-
evictEntityData
public void evictEntityData(String entityName, Object identifier)
Description copied from interface:CacheEvict 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:
evictEntityDatain interfaceCache- Parameters:
entityName- The entity nameidentifier- The entity identifier
-
evictEntityData
public void evictEntityData(Class<?> entityClass)
Description copied from interface:CacheEvict 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:
evictEntityDatain interfaceCache- Parameters:
entityClass- The entity type
-
evictEntityData
public void evictEntityData(String entityName)
Description copied from interface:CacheEvict 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:
evictEntityDatain interfaceCache- Parameters:
entityName- The entity name
-
evictEntityData
public void evictEntityData()
Description copied from interface:CacheEvict all cached data from every cache region to which any entity type is assigned.- Specified by:
evictEntityDatain interfaceCache
-
evictNaturalIdData
public void evictNaturalIdData(Class<?> entityClass)
Description copied from interface:CacheEvict all cached natural id mappings for the given entity type.- Specified by:
evictNaturalIdDatain interfaceCache- Parameters:
entityClass- The entity type
-
evictNaturalIdData
public void evictNaturalIdData(String entityName)
Description copied from interface:CacheEvict all cached natural id mappings for the entity type with the given name.- Specified by:
evictNaturalIdDatain interfaceCache- Parameters:
entityName- The entity name
-
evictNaturalIdData
public void evictNaturalIdData()
Description copied from interface:CacheEvict all cached natural id mappings for every entity type.- Specified by:
evictNaturalIdDatain interfaceCache
-
containsCollection
public boolean containsCollection(String role, Object ownerIdentifier)
Description copied from interface:CacheDetermine whether the cache contains an item for the collection with the given role and given identifier.- Specified by:
containsCollectionin interfaceCache- Parameters:
role- The name of the collection role in the formpackage.OwnerEntityName.collectionPropertyNameownerIdentifier- 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:CacheEvict the cached item for the collection with the given role and given identifier, if there is any such item in the cache.- Specified by:
evictCollectionDatain interfaceCache- Parameters:
role- The name of the collection role in the formpackage.OwnerEntityName.collectionPropertyNameownerIdentifier- The identifier of the owning entity
-
evictCollectionData
public void evictCollectionData(String role)
Description copied from interface:CacheEvict all cached data from the cache region to which the given collection role is assigned.- Specified by:
evictCollectionDatain interfaceCache- Parameters:
role- The name of the collection role in the formpackage.OwnerEntityName.collectionPropertyName
-
evictCollectionData
public void evictCollectionData()
Description copied from interface:CacheEvict all cache data from every cache region to which some collection role is assigned.- Specified by:
evictCollectionDatain interfaceCache
-
containsQuery
public boolean containsQuery(String regionName)
Description copied from interface:CacheDetermine whether the given region name contains cached query results.- Specified by:
containsQueryin interfaceCache- 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:CacheEvict all cached query results from the default region.- Specified by:
evictDefaultQueryRegionin interfaceCache
-
evictQueryRegion
public void evictQueryRegion(String regionName)
Description copied from interface:CacheEvict all cached query results from the region with the given name.- Specified by:
evictQueryRegionin interfaceCache- Parameters:
regionName- The cache name associated to the queries being cached.
-
evictQueryRegions
public void evictQueryRegions()
Description copied from interface:CacheEvict all cached query results from every region.- Specified by:
evictQueryRegionsin interfaceCache
-
evictRegion
public void evictRegion(String regionName)
Description copied from interface:CacheEvict all cached data from the named cache region.- Specified by:
evictRegionin interfaceCache
-
getRegion
public Region getRegion(String fullRegionName)
Description copied from interface:CacheImplementorGet a cache Region by name. If there is both aDomainDataRegionand aQueryResultsRegionwith the specified name, then theDomainDataRegionwill be returned.- Specified by:
getRegionin interfaceCacheImplementor
-
getTimestampsCache
public TimestampsCache getTimestampsCache()
Description copied from interface:CacheImplementorFind the cache data access strategy for Hibernate's timestamps cache. Will returnnullif Hibernate is not configured for query result caching- Specified by:
getTimestampsCachein interfaceCacheImplementor
-
getDefaultQueryResultsCache
public QueryResultsCache getDefaultQueryResultsCache()
Description copied from interface:CacheImplementorAccess 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
public QueryResultsCache getQueryResultsCache(String regionName)
Description copied from interface:CacheImplementorGet query cache byregion nameor 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
public QueryResultsCache getQueryResultsCacheStrictly(String regionName)
Description copied from interface:CacheImplementorGet 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
-
close
public void close()
Description copied from interface:CacheImplementorClose this "cache", releasing all underlying resources.- Specified by:
closein interfaceCacheImplementor
-
getCacheRegionNames
public Set<String> getCacheRegionNames()
Description copied from interface:CacheImplementorThe unqualified name of all regions. Intended for use withCacheImplementor.getRegion(java.lang.String)- Specified by:
getCacheRegionNamesin interfaceCacheImplementor
-
getEntityRegionAccess
@Deprecated public EntityDataAccess getEntityRegionAccess(NavigableRole rootEntityName)
Deprecated.Description copied from interface:CacheImplementorFind 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 public NaturalIdDataAccess getNaturalIdCacheRegionAccessStrategy(NavigableRole rootEntityName)
Deprecated.Description copied from interface:CacheImplementorFind 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 public CollectionDataAccess getCollectionRegionAccess(NavigableRole collectionRole)
Deprecated.Description copied from interface:CacheImplementorFind the cache data access strategy for the given collection. Will returnnullwhen the collection is not configured for caching.- Specified by:
getCollectionRegionAccessin interfaceCacheImplementor
-
-