Top Description Interfaces Classes
[default module]

Package org.hibernate.cache


This package defines APIs/SPIs and implementations for the Hibernate second-level cache.

The legacy (and now deprecated) approach to caching is defined by the org.hibernate.cache.CacheProvider and org.hibernate.cache.Cache interfaces as well as the org.hibernate.cache.CacheConcurrencyStrategy interface along with the various implementations of all these interfaces. In that scheme, a org.hibernate.cache.CacheProvider defined how to configure and perform lifecycle operations in regards to a particular underlying caching library; it also defined how to build org.hibernate.cache.Cache instances which in turn defined how to access the "regions" of the underlying cache instance. For entity and collection data cache regions, org.hibernate.cache.CacheConcurrencyStrategy wrapped access to those cache regions to apply transactional/concurrent access semantics.

The improved approach is based on org.hibernate.cache.RegionFactory, the various org.hibernate.cache.Region specializations and the two access strategies contracts (org.hibernate.cache.access.EntityRegionAccessStrategy and org.hibernate.cache.access.CollectionRegionAccessStrategy). The general approach here is that org.hibernate.cache.RegionFactory defined how to configure and perform lifecycle operations in regards to a particular underlying caching library (or libraries). org.hibernate.cache.RegionFactory also defines how to build specialized org.hibernate.cache.Region instances based on the type of data we will be storing in that given region. The fact that org.hibernate.cache.RegionFactory is asked to build specialized regions (as opposed to just general access) is the first improvement over the legacy scheme. The second improvement is the fact that the regions (well the ones like entity and collection regions that are responsible for storing transactional data) are asked to build their own access strategies (see org.hibernate.cache.EntityRegion#buildAccessStrategy and org.hibernate.cache.CollectionRegion#buildAccessStrategy).

Interface Summary

Modifier and TypeInterface and Description
public interface
public interface
public interface
CacheDataDescription

Describes attributes regarding the type of data to be cached.

public interface
public interface
CollectionRegion

Defines the contract for a cache region which will specifically be used to store collection data.

public interface
EntityRegion

Defines the contract for a cache region which will specifically be used to store entity data.

public interface
GeneralDataRegion

Contract for general-purpose cache regions.

public interface
OptimisticCache

Deprecated as a consequence of Cache being deprecated.
A contract for transactional cache implementations which support optimistic locking of items within the cache.
public interface
OptimisticCacheSource

Contract for sources of optimistically lockable data sent to the second level cache.

public interface
QueryCache

Defines the contract for caches capable of storing query results.

public interface
QueryCacheFactory

Defines a factory for query cache instances.

public interface
QueryResultsRegion

Defines the contract for a cache region which will specifically be used to store query results.

public interface
Region

Defines a contract for accessing a particular named region within the underlying cache implementation.

public interface
RegionFactory

Contract for building second level cache regions.

public interface
TimestampsRegion

Defines the contract for a cache region which will specifically be used to store entity "update timestamps".

public interface
TransactionalDataRegion

Defines contract for regions which hold transactionally-managed data.

public interface
TransactionAwareCache

Marker interface for identifying cache impls which are aware of JTA transactions

Class Summary

Modifier and TypeClass and Description
public abstract class
AbstractJndiBoundCacheProvider

Deprecated as a consequence of CacheProvider being deprecated.
Support for CacheProvider implementations which are backed by caches bound into JNDI namespace.
public class
CacheException

Something went wrong in the cache

public class
CacheKey

Allows multiple entity classes / collection roles to be stored in the same cache region.

public class
FilterKey

Allows cached queries to be keyed by enabled filters.

public class
HashtableCache

Deprecated as a consequence of Cache being deprecated.
A lightweight implementation of the Cache interface
public class
HashtableCacheProvider

Deprecated as a consequence of CacheProvider being deprecated.
A simple in-memory Hashtable-based cache impl.
public class
NoCacheProvider

Deprecated as a consequence of CacheProvider being deprecated.
Implementation of NoCacheProvider.
public class
NoCachingEnabledException

Implementation of NoCachingEnabledException.

public class
NonstrictReadWriteCache

Deprecated as a consequence of CacheConcurrencyStrategy being deprecated.
Caches data that is sometimes updated without ever locking the cache.
public class
QueryKey

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

public class
ReadOnlyCache

Deprecated as a consequence of CacheConcurrencyStrategy being deprecated.
Caches data that is never updated.
public class
ReadWriteCache

Deprecated as a consequence of CacheConcurrencyStrategy being deprecated.
Caches data that is sometimes updated while maintaining the semantics of "read committed" isolation level.
public class
StandardQueryCache

The standard implementation of the Hibernate QueryCache interface.

public class
StandardQueryCacheFactory

Standard Hibernate implementation of the QueryCacheFactory interface.

public class
Timestamper

Generates increasing identifiers (in a single VM only).

public class
TransactionalCache

Deprecated as a consequence of CacheConcurrencyStrategy being deprecated.
Support for fully transactional cache implementations like JBoss TreeCache.
public class
UpdateTimestampsCache

Tracks the timestamps of the most recent updates to particular tables.