Top Description Methods
org.hibernate.cache.spi

public Interface CacheImplementor

extends Service, Cache, CacheImplementor, Serializable
Known Direct Implementers
org.hibernate.cache.internal.DisabledCaching, org.hibernate.cache.internal.EnabledCaching
Annotations
@SuppressWarnings:unused
Imports
java.io.Serializable, java.util.Locale, .Set, org.hibernate.Cache, .HibernateException, org.hibernate.cache.cfg.spi.DomainDataRegionConfig, org.hibernate.cache.spi.access.CollectionDataAccess, .EntityDataAccess, .NaturalIdDataAccess, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.persister.entity.EntityPersister, org.hibernate.service.Service

Deprecated

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

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()

Redeclares org.hibernate.engine.spi.CacheImplementor.close.

Close this "cache", releasing all underlying resources.
public default void
evictQueries()

Overrides default org.hibernate.engine.spi.CacheImplementor.evictQueries.

Clean up the default query cache
public Set<String>
public CollectionDataAccess
getCollectionRegionAccess(NavigableRole collectionRole)

Redeclares org.hibernate.engine.spi.CacheImplementor.getCollectionRegionAccess.

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

Overrides default org.hibernate.engine.spi.CacheImplementor.getDefaultQueryCache.

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

Redeclares org.hibernate.engine.spi.CacheImplementor.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
)

Redeclares org.hibernate.engine.spi.CacheImplementor.getEntityRegionAccess.

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

Redeclares org.hibernate.engine.spi.CacheImplementor.getNaturalIdAccessesInRegion.

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
)

Redeclares org.hibernate.engine.spi.CacheImplementor.getNaturalIdCacheRegionAccessStrategy.

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

Overrides default org.hibernate.engine.spi.CacheImplementor.getQueryCache.

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

Overrides default org.hibernate.engine.spi.CacheImplementor.getQueryCache.

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

Redeclares org.hibernate.engine.spi.CacheImplementor.getQueryResultsCache.

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)

Redeclares org.hibernate.engine.spi.CacheImplementor.getQueryResultsCacheStrictly.

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)

Redeclares org.hibernate.engine.spi.CacheImplementor.getRegion.

Get a cache Region by name.
public default Region
getRegionByLegacyName(String legacyName)

Overrides default org.hibernate.engine.spi.CacheImplementor.getRegionByLegacyName.

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

Redeclares org.hibernate.engine.spi.CacheImplementor.getRegionFactory.

The underlying RegionFactory in use.
public String[]

Returns:

All cache region names
getSecondLevelCacheRegionNames
()

Redeclares org.hibernate.engine.spi.CacheImplementor.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, org.hibernate.engine.spi.CacheImplementor.getSessionFactory.

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

Redeclares org.hibernate.engine.spi.CacheImplementor.getTimestampsCache.

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

Overrides default org.hibernate.engine.spi.CacheImplementor.getUpdateTimestampsCache.

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

Redeclares org.hibernate.engine.spi.CacheImplementor.prime.

An initialization phase allowing the caching provider to prime itself from the passed configs
public default String
unqualifyRegionName(String name)

Overrides default org.hibernate.engine.spi.CacheImplementor.unqualifyRegionName.

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()

Redeclares org.hibernate.engine.spi.CacheImplementor.close.

Close this "cache", releasing all underlying resources.

evictQueriesback to summary
public default void evictQueries() throws HibernateException

Overrides default org.hibernate.engine.spi.CacheImplementor.evictQueries.

Clean up the default query cache

getCacheRegionNamesback to summary
public Set<String> getCacheRegionNames()

Redeclares org.hibernate.engine.spi.CacheImplementor.getCacheRegionNames.

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

Since
5.3
getCollectionRegionAccessback to summary
public CollectionDataAccess getCollectionRegionAccess(NavigableRole collectionRole)

Redeclares org.hibernate.engine.spi.CacheImplementor.getCollectionRegionAccess.

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()

Overrides default org.hibernate.engine.spi.CacheImplementor.getDefaultQueryCache.

Deprecated

Use getDefaultQueryResultsCache instead.

Get the default QueryCache.

Annotations
@Deprecated
getDefaultQueryResultsCacheback to summary
public QueryResultsCache getDefaultQueryResultsCache()

Redeclares org.hibernate.engine.spi.CacheImplementor.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)

Redeclares org.hibernate.engine.spi.CacheImplementor.getEntityRegionAccess.

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)

Redeclares org.hibernate.engine.spi.CacheImplementor.getNaturalIdAccessesInRegion.

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)

Redeclares org.hibernate.engine.spi.CacheImplementor.getNaturalIdCacheRegionAccessStrategy.

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()

Overrides default org.hibernate.engine.spi.CacheImplementor.getQueryCache.

Deprecated

Use getDefaultQueryResultsCache instead.

Get the default QueryCache.

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

Overrides default org.hibernate.engine.spi.CacheImplementor.getQueryCache.

Deprecated

Use getQueryResultsCache(String) instead, but using unqualified name

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

Redeclares org.hibernate.engine.spi.CacheImplementor.getQueryResultsCache.

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)

Redeclares org.hibernate.engine.spi.CacheImplementor.getQueryResultsCacheStrictly.

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)

Redeclares org.hibernate.engine.spi.CacheImplementor.getRegion.

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.

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)

Overrides default org.hibernate.engine.spi.CacheImplementor.getRegionByLegacyName.

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()

Redeclares org.hibernate.engine.spi.CacheImplementor.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()

Redeclares org.hibernate.engine.spi.CacheImplementor.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, org.hibernate.engine.spi.CacheImplementor.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()

Redeclares org.hibernate.engine.spi.CacheImplementor.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()

Overrides default org.hibernate.engine.spi.CacheImplementor.getUpdateTimestampsCache.

Deprecated

Use getTimestampsCache instead

Get UpdateTimestampsCache instance managed by the SessionFactory.

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

Redeclares org.hibernate.engine.spi.CacheImplementor.prime.

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)

Overrides default org.hibernate.engine.spi.CacheImplementor.unqualifyRegionName.

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