public class DisabledCaching extends Object implements CacheImplementor
Constructor and Description |
---|
DisabledCaching(SessionFactoryImplementor sessionFactory) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this "cache", releasing all underlying resources.
|
boolean |
contains(Class cls,
Object primaryKey)
Whether the cache contains data for the given entity.
|
boolean |
containsCollection(String role,
Serializable ownerIdentifier)
Determine whether the cache contains data for the given collection.
|
boolean |
containsEntity(Class entityClass,
Serializable identifier)
Determine whether the cache contains data for the given entity "instance".
|
boolean |
containsEntity(String entityName,
Serializable identifier)
Determine whether the cache contains data for the given entity "instance".
|
boolean |
containsQuery(String regionName)
Determine whether the cache contains data for the given query.
|
void |
evict(Class cls)
Remove the data for entities of the specified class (and its
subclasses) from the cache.
|
void |
evict(Class cls,
Object primaryKey)
Remove the data for the given entity from the cache.
|
void |
evictCollectionData()
Evict cache data for all collections
|
void |
evictCollectionData(String role)
Evicts cached data for the given collection role
|
void |
evictCollectionData(String role,
Serializable ownerIdentifier)
Evicts the cache data for the given identified collection "instance"
|
void |
evictDefaultQueryRegion()
Evicts all cached query results from the default region.
|
void |
evictEntityData()
Evict data from all entity regions.
|
void |
evictEntityData(Class entityClass)
Evicts all entity data from the given region (i.e.
|
void |
evictEntityData(Class entityClass,
Serializable identifier)
Evicts the entity data for a particular entity "instance".
|
void |
evictEntityData(String entityName)
Evicts all entity data from the given region (i.e.
|
void |
evictEntityData(String entityName,
Serializable identifier)
Evicts the entity data for a particular entity "instance".
|
void |
evictNaturalIdData()
Evict cached data for all natural-ids (for all entities)
|
void |
evictNaturalIdData(Class entityClass)
Evict cached data for the given entity's natural-id
|
void |
evictNaturalIdData(String entityName)
Evict cached data for the given entity's natural-id
|
void |
evictQueryRegion(String regionName)
Evicts all cached query results under the given name.
|
void |
evictQueryRegions()
Evict data from all query regions.
|
void |
evictRegion(String regionName)
Evict all data from the named cache region
|
Set<String> |
getCacheRegionNames()
The unqualified name of all regions.
|
CollectionDataAccess |
getCollectionRegionAccess(NavigableRole collectionRole)
Find the cache data access strategy for the given collection.
|
QueryResultsCache |
getDefaultQueryResultsCache()
Access to the "default" region used to store query results when caching
was requested but no region was explicitly named.
|
EntityDataAccess |
getEntityRegionAccess(NavigableRole rootEntityName)
Find the cache data access strategy for an entity.
|
Set<NaturalIdDataAccess> |
getNaturalIdAccessesInRegion(String regionName) |
NaturalIdDataAccess |
getNaturalIdCacheRegionAccessStrategy(NavigableRole rootEntityName)
Find the cache data access strategy for the given entity's natural-id cache.
|
QueryResultsCache |
getQueryResultsCache(String regionName)
Get query cache by region name or create a new one if none exist.
|
QueryResultsCache |
getQueryResultsCacheStrictly(String regionName)
Get the named QueryResultRegionAccess but not creating one if it
does not already exist.
|
Region |
getRegion(String fullRegionName)
Get a cache Region by name
|
RegionFactory |
getRegionFactory()
The underlying RegionFactory in use.
|
String[] |
getSecondLevelCacheRegionNames()
Get the *qualified* names of all regions caching entity and collection data.
|
SessionFactoryImplementor |
getSessionFactory()
Access to the SessionFactory this Cache is bound to.
|
TimestampsCache |
getTimestampsCache()
Find the cache data access strategy for Hibernate's timestamps cache.
|
void |
prime(Set<DomainDataRegionConfig> cacheRegionConfigs)
An initialization phase allowing the caching provider to prime itself
from the passed configs
|
<T> T |
unwrap(Class<T> cls)
Return an object of the specified type to allow access to the
provider-specific API.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
evictQueries, getDefaultQueryCache, getQueryCache, getQueryCache, getRegionByLegacyName, getUpdateTimestampsCache, unqualifyRegionName
evictAll, evictAllRegions, evictCollection, evictCollectionRegion, evictCollectionRegions, evictEntity, evictEntity, evictEntityRegion, evictEntityRegion, evictEntityRegions, evictNaturalIdRegion, evictNaturalIdRegion, evictNaturalIdRegions
public DisabledCaching(SessionFactoryImplementor sessionFactory)
public SessionFactoryImplementor getSessionFactory()
Cache
getSessionFactory
in interface CacheImplementor
public RegionFactory getRegionFactory()
CacheImplementor
getRegionFactory
in interface CacheImplementor
public void prime(Set<DomainDataRegionConfig> cacheRegionConfigs)
CacheImplementor
prime
in interface CacheImplementor
public boolean containsEntity(Class entityClass, Serializable identifier)
Cache
entityClass
- The entity class.identifier
- The entity identifierpublic boolean containsEntity(String entityName, Serializable identifier)
Cache
entityName
- The entity name.identifier
- The entity identifierpublic void evictEntityData(Class entityClass, Serializable identifier)
Cache
entityClass
- The entity class.identifier
- The entity identifierpublic void evictEntityData(String entityName, Serializable identifier)
Cache
entityName
- The entity name.identifier
- The entity identifierpublic void evictEntityData(Class entityClass)
Cache
entityClass
- The entity class.public void evictEntityData(String entityName)
Cache
entityName
- The entity name.public void evictEntityData()
Cache
public void evictNaturalIdData(Class entityClass)
Cache
entityClass
- The entity class.public void evictNaturalIdData(String entityName)
Cache
entityName
- The entity name.public void evictNaturalIdData()
Cache
public boolean containsCollection(String role, Serializable ownerIdentifier)
Cache
role
- The name of the collection role (in form
[owner-entity-name].[collection-property-name]) whose regions should be
evicted.ownerIdentifier
- The identifier of the owning entitypublic void evictCollectionData(String role, Serializable ownerIdentifier)
Cache
role
- The "collection role" (in form [owner-entity-name].[collection-property-name]).ownerIdentifier
- The identifier of the owning entitypublic void evictCollectionData(String role)
Cache
role
- The "collection role" (in form [owner-entity-name].[collection-property-name]).public void evictCollectionData()
Cache
public boolean containsQuery(String regionName)
Cache
regionName
- The cache name given to the query.public void evictDefaultQueryRegion()
Cache
public void evictQueryRegion(String regionName)
Cache
regionName
- The cache name associated to the queries being cached.public void evictQueryRegions()
Cache
public void evictRegion(String regionName)
Cache
public Region getRegion(String fullRegionName)
CacheImplementor
getRegion
in interface CacheImplementor
public TimestampsCache getTimestampsCache()
CacheImplementor
null
if Hibernate is not configured for query result cachinggetTimestampsCache
in interface CacheImplementor
public QueryResultsCache getDefaultQueryResultsCache()
CacheImplementor
null
if Hibernate is not configured for query result cachinggetDefaultQueryResultsCache
in interface CacheImplementor
public QueryResultsCache getQueryResultsCache(String regionName)
CacheImplementor
null
if Hibernate is not configured for query result cachinggetQueryResultsCache
in interface CacheImplementor
public QueryResultsCache getQueryResultsCacheStrictly(String regionName)
CacheImplementor
null
if Hibernate is not configured for query result
caching or if no such region (yet) existsgetQueryResultsCacheStrictly
in interface CacheImplementor
public void close()
CacheImplementor
close
in interface CacheImplementor
public String[] getSecondLevelCacheRegionNames()
CacheImplementor
getSecondLevelCacheRegionNames
in interface CacheImplementor
public Set<String> getCacheRegionNames()
CacheImplementor
CacheImplementor.getRegion(java.lang.String)
getCacheRegionNames
in interface CacheImplementor
public EntityDataAccess getEntityRegionAccess(NavigableRole rootEntityName)
CacheImplementor
null
when the entity is not configured for caching.getEntityRegionAccess
in interface CacheImplementor
rootEntityName
- The NavigableRole representation of the root entitypublic NaturalIdDataAccess getNaturalIdCacheRegionAccessStrategy(NavigableRole rootEntityName)
CacheImplementor
null
when the entity does not define a natural-id, or its
natural-id is not configured for caching.getNaturalIdCacheRegionAccessStrategy
in interface CacheImplementor
rootEntityName
- The NavigableRole representation of the root entitypublic CollectionDataAccess getCollectionRegionAccess(NavigableRole collectionRole)
CacheImplementor
null
when the collection is not configured for caching.getCollectionRegionAccess
in interface CacheImplementor
public boolean contains(Class cls, Object primaryKey)
Cache
public void evict(Class cls, Object primaryKey)
Cache
public void evict(Class cls)
Cache
public <T> T unwrap(Class<T> cls)
Cache
public Set<NaturalIdDataAccess> getNaturalIdAccessesInRegion(String regionName)
getNaturalIdAccessesInRegion
in interface CacheImplementor
Copyright © 2019 JBoss by Red Hat. All rights reserved.