Top Description Methods
org.hibernate.engine.spi

public Interface CacheImplementor

extends Service, Cache, Serializable
Known Direct Subinterfaces
org.hibernate.cache.spi.CacheImplementor
Annotations
@Deprecated
@SuppressWarnings:unused
Imports
java.io.Serializable, java.util.Locale, .Set, org.hibernate.Cache, .HibernateException, org.hibernate.cache.cfg.spi.DomainDataRegionConfig, org.hibernate.cache.spi.QueryCache, .QueryResultsCache, .Region, .RegionFactory, .TimestampsCache, .UpdateTimestampsCache, org.hibernate.cache.spi.access.CollectionDataAccess, .EntityDataAccess, .NaturalIdDataAccess, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.persister.entity.EntityPersister, org.hibernate.service.Service

Deprecated

Moved to org.hibernate.cache.spi.CacheImplementor

SPI contract for Hibernate's second-level cache engine
Authors
Strong Liu, Steve Ebersole
Since
4.1

Method Summary

Modifier and TypeMethod and Description
public void
close()

Close this "cache", releasing all underlying resources.

public default void
evictQueries()

Clean up the default query cache

public Set<String>
getCacheRegionNames()

The unqualified name of all regions.

public CollectionDataAccess
getCollectionRegionAccess(NavigableRole collectionRole)

Find the cache data access strategy for the given collection.
public default QueryCache
getDefaultQueryCache()

Deprecated Use getDefaultQueryResultsCache instead.
Get the default QueryCache.
public QueryResultsCache
getDefaultQueryResultsCache()

Deprecated as a consequence of QueryResultsCache being deprecated.
Access to the "default" region used to store query results when caching was requested but no region was explicitly named.
public EntityDataAccess
getEntityRegionAccess(NavigableRole
The NavigableRole representation of the root entity
rootEntityName
)

Find the cache data access strategy for an entity.
public Set<NaturalIdDataAccess>
getNaturalIdAccessesInRegion(String legacyQualifiedRegionName)

Deprecated No replacement - added just for support of the newly deprecated methods expecting a qualified region name
public NaturalIdDataAccess
getNaturalIdCacheRegionAccessStrategy(NavigableRole
The NavigableRole representation of the root entity
rootEntityName
)

Find the cache data access strategy for the given entity's natural-id cache.
public default QueryCache
getQueryCache()

Deprecated Use getDefaultQueryResultsCache instead.
Get the default QueryCache.
public default QueryCache
getQueryCache(String regionName)

Deprecated Use getQueryResultsCache(String) instead, but using unqualified name
public QueryResultsCache
getQueryResultsCache(String regionName)

Deprecated as a consequence of QueryResultsCache being deprecated.
Get query cache by region name or create a new one if none exist.
public QueryResultsCache
getQueryResultsCacheStrictly(String regionName)

Deprecated as a consequence of QueryResultsCache being deprecated.
Get the named QueryResultRegionAccess but not creating one if it does not already exist.
public Region
getRegion(String regionName)

Get a cache Region by name

public default Region
getRegionByLegacyName(String legacyName)

Deprecated No replacement - added just for support of the newly deprecated methods expecting a qualified region name
public RegionFactory
getRegionFactory()

The underlying RegionFactory in use.

public String[]

Returns:

All cache region names
getSecondLevelCacheRegionNames
()

Deprecated (since 5.3) Use CacheImplementor#getCacheRegionNames() instead
Get the *qualified* names of all regions caching entity and collection data.
public SessionFactoryImplementor
getSessionFactory()

Redeclares org.hibernate.Cache.getSessionFactory.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Access to the SessionFactory this Cache is bound to.
public TimestampsCache
getTimestampsCache()

Deprecated as a consequence of TimestampsCache being deprecated.
Find the cache data access strategy for Hibernate's timestamps cache.
public default UpdateTimestampsCache
getUpdateTimestampsCache()

Deprecated Use getTimestampsCache instead
Get UpdateTimestampsCache instance managed by the SessionFactory.
public void
prime(Set<DomainDataRegionConfig> cacheRegionConfigs)

An initialization phase allowing the caching provider to prime itself from the passed configs

public default String
unqualifyRegionName(String name)

Deprecated (since 5.3) No replacement - added just to continue some backwards compatibility in supporting the newly deprecated methods expecting a qualified (prefix +) region name
Inherited from org.hibernate.Cache:
containsCollectioncontainsEntitycontainsEntitycontainsQueryevictAllevictAllRegionsevictCollectionevictCollectionDataevictCollectionDataevictCollectionDataevictCollectionRegionevictCollectionRegionsevictDefaultQueryRegionevictEntityevictEntityevictEntityDataevictEntityDataevictEntityDataevictEntityDataevictEntityDataevictEntityRegionevictEntityRegionevictEntityRegionsevictNaturalIdDataevictNaturalIdDataevictNaturalIdDataevictNaturalIdRegionevictNaturalIdRegionevictNaturalIdRegionsevictQueryRegionevictQueryRegionsevictRegion

Method Detail

closeback to summary
public void close()

Close this "cache", releasing all underlying resources.

evictQueriesback to summary
public default void evictQueries() throws HibernateException

Clean up the default query cache

getCacheRegionNamesback to summary
public Set<String> getCacheRegionNames()

The unqualified name of all regions. Intended for use with getRegion

Since
5.3
getCollectionRegionAccessback to summary
public 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

It is only valid to call this method after prime has been performed

Annotations
@Deprecated
getDefaultQueryCacheback to summary
public default QueryCache getDefaultQueryCache()

Deprecated

Use getDefaultQueryResultsCache instead.

Get the default QueryCache.

Annotations
@Deprecated
getDefaultQueryResultsCacheback to summary
public QueryResultsCache getDefaultQueryResultsCache()

Deprecated

as a consequence of QueryResultsCache being deprecated. See corresponding docs for further information.

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

getEntityRegionAccessback to summary
public EntityDataAccess getEntityRegionAccess(NavigableRole rootEntityName)

Find the cache data access strategy for an entity. Will return null when the entity is not configured for caching.

API Note

It is only valid to call this method after prime has been performed

Parameters
rootEntityName:NavigableRole

The NavigableRole representation of the root entity

Annotations
@Deprecated
getNaturalIdAccessesInRegionback to summary
public Set<NaturalIdDataAccess> getNaturalIdAccessesInRegion(String legacyQualifiedRegionName)

Deprecated

No replacement - added just for support of the newly deprecated methods expecting a qualified region name

Annotations
@Deprecated
getNaturalIdCacheRegionAccessStrategyback to summary
public 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.

API Note

It is only valid to call this method after prime has been performed

Parameters
rootEntityName:NavigableRole

The NavigableRole representation of the root entity

Annotations
@Deprecated
getQueryCacheback to summary
public default QueryCache getQueryCache()

Deprecated

Use getDefaultQueryResultsCache instead.

Get the default QueryCache.

Annotations
@Deprecated
getQueryCacheback to summary
public default QueryCache getQueryCache(String regionName) throws HibernateException

Deprecated

Use getQueryResultsCache(String) instead, but using unqualified name

Annotations
@Deprecated
getQueryResultsCacheback to summary
public QueryResultsCache getQueryResultsCache(String regionName)

Deprecated

as a consequence of QueryResultsCache being deprecated. See corresponding docs for further information.

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

getQueryResultsCacheStrictlyback to summary
public QueryResultsCache getQueryResultsCacheStrictly(String regionName)

Deprecated

as a consequence of QueryResultsCache being deprecated. See corresponding docs for further information.

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
getRegionback to summary
public Region getRegion(String regionName)

Get a cache Region by name

API Note

It is only valid to call this method after prime has been performed

Since
5.3
getRegionByLegacyNameback to summary
public default Region getRegionByLegacyName(String legacyName)

Deprecated

No replacement - added just for support of the newly deprecated methods expecting a qualified region name

Annotations
@Deprecated
getRegionFactoryback to summary
public 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.

getSecondLevelCacheRegionNamesback to summary
public String[] getSecondLevelCacheRegionNames()

Deprecated

(since 5.3) Use CacheImplementor#getCacheRegionNames() instead

Get the *qualified* names of all regions caching entity and collection data.

Returns:String[]

All cache region names

Annotations
@Deprecated
getSessionFactoryback to summary
public SessionFactoryImplementor getSessionFactory()

Redeclares org.hibernate.Cache.getSessionFactory.

Doc from org.hibernate.Cache.getSessionFactory.

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Access to the SessionFactory this Cache is bound to.

Returns:SessionFactoryImplementor

The SessionFactory

Annotations
@Override
getTimestampsCacheback to summary
public TimestampsCache getTimestampsCache()

Deprecated

as a consequence of TimestampsCache being deprecated. See corresponding docs for further information.

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
getUpdateTimestampsCacheback to summary
public default UpdateTimestampsCache getUpdateTimestampsCache()

Deprecated

Use getTimestampsCache instead

Get UpdateTimestampsCache instance managed by the SessionFactory.

Annotations
@Deprecated
primeback to summary
public void prime(Set<DomainDataRegionConfig> cacheRegionConfigs)

An initialization phase allowing the caching provider to prime itself from the passed configs

Since
5.3
unqualifyRegionNameback to summary
public default String unqualifyRegionName(String name)

Deprecated

(since 5.3) No replacement - added just to continue some backwards compatibility in supporting the newly deprecated methods expecting a qualified (prefix +) region name

Annotations
@Deprecated