Top Description Interfaces Classes
[default module]

Package org.hibernate.cache.spi


Defines the integration aspect of Hibernate's second-level caching, allowing a "caching backend" to be plugged in as a cache provider.

org.hibernate.cache.spi.RegionFactory is the main integration contract that defines how Hibernate interacts with the provider. Its main contract is the generation of org.hibernate.cache.spi.Region references with some requested intent (what will be stored there).

A provider will integrate with Hibernate by implementing either:

  1. the contracts in org.hibernate.cache.spi,
  2. the contracts in org.hibernate.cache.spi.support, or
  3. a mix of the above.
The first approach allows for more control over the setup, but also requires more work. The second approach minimizes the work needed to integrate with a cache provider: the integrator is only required to implement the contracts org.hibernate.cache.spi.support.StorageAccess and org.hibernate.cache.spi.support.DomainDataStorageAccess, which are basic read/write abstractions of the underlying cache. That is to say, org.hibernate.cache.spi.support comes with a nearly complete implementation, except for these "storage access" objects.

Alternatively, providers may integrate with Hibernate via Hibernate's support for JCache, which is defined by the hibernate-jcache module. No custom code is necessary, just an implementation of JCache, properly registered via the JCache spec.

Interface Summary

Modifier and TypeInterface and Description
public interface
CacheImplementor

An SPI supported by any Hibernate service that provides an implementation of the Cache API.

public interface
CacheKeysFactory

A factory for keys into the second-level cache.

public interface
CacheTransactionSynchronization

Defines a context object that a RegionFactory is asked to create (RegionFactory#createTransactionContext}) when a Hibernate Session is created.

public interface
DirectAccessRegion

Specialized Region whose data is accessed directly, without the need for key/item wrapping.

public interface
DomainDataRegion

A second-level cache region that holds cacheable domain data:

  • the destructured state of entity instances and collections, and
  • mappings from natural id to primary key.
public interface
ExtendedStatisticsSupport

Optional contract for a Region defining support for extra statistic information.

public interface
QueryResultsCache

Responsible for managing query result list caching in a specific query cache region.

public interface
QueryResultsRegion

Defines the contract for a cache region that stores query results.

public interface
Region

Contract for a named cache "region".

public interface
RegionFactory

Contract for building second-level cache regions, including regions dedicated to storing:

public interface
public interface
TimestampsCache

Tracks invalidation of "query spaces" (tables) for the purpose of determining if a cached query result set is stale.

public interface
TimestampsCacheFactory

Responsible for building the TimestampsCache to use for managing query results with respect to staleness of the underlying tables (sometimes called "query spaces" or "table spaces").

public interface
TimestampsRegion

Defines the contract for a cache region that stores timestamps.

Class Summary

Modifier and TypeClass and Description
public abstract class
public abstract class
public class
FilterKey

Deprecated since 6.2. this class is no longer used
Allows cached queries to be keyed by enabled filters.
public class
QueryKey

A key that identifies a particular query with bound parameter values.

public class
QuerySpacesHelper

Deprecated since 6.2. This helper class is no longer used
public class