Package org.hibernate.cache.internal
Class QueryResultsCacheImpl
- java.lang.Object
-
- org.hibernate.cache.internal.QueryResultsCacheImpl
-
- All Implemented Interfaces:
QueryResultsCache
public class QueryResultsCacheImpl extends Object implements QueryResultsCache
The standard implementation of the Hibernate QueryCache interface. Works hind-in-hand withTimestampsCache
to help in recognizing stale query results.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QueryResultsCacheImpl.CacheItem
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<?>
get(QueryKey key, String[] spaces, SharedSessionContractImplementor session)
Get results from the cache.List<?>
get(QueryKey key, Set<String> spaces, SharedSessionContractImplementor session)
Get results from the cache.QueryResultsRegion
getRegion()
The underlying cache region being used.boolean
put(QueryKey key, List<?> results, SharedSessionContractImplementor session)
Put a result into the query cache.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.cache.spi.QueryResultsCache
clear, destroy
-
-
-
-
Method Detail
-
getRegion
public QueryResultsRegion getRegion()
Description copied from interface:QueryResultsCache
The underlying cache region being used.- Specified by:
getRegion
in interfaceQueryResultsCache
-
put
public boolean put(QueryKey key, List<?> results, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:QueryResultsCache
Put a result into the query cache.- Specified by:
put
in interfaceQueryResultsCache
- Parameters:
key
- The cache keyresults
- The results to cachesession
- The originating session- Returns:
- Whether the put actually happened.
- Throws:
HibernateException
- Indicates a problem delegating to the underlying cache.
-
get
public List<?> get(QueryKey key, Set<String> spaces, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:QueryResultsCache
Get results from the cache.- Specified by:
get
in interfaceQueryResultsCache
- Parameters:
key
- The cache keyspaces
- The query spaces (used in invalidation plus validation checks)session
- The originating session- Returns:
- The cached results; may be null.
- Throws:
HibernateException
- Indicates a problem delegating to the underlying cache.
-
get
public List<?> get(QueryKey key, String[] spaces, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:QueryResultsCache
Get results from the cache.- Specified by:
get
in interfaceQueryResultsCache
- Parameters:
key
- The cache keyspaces
- The query spaces (used in invalidation plus validation checks)session
- The originating session- Returns:
- The cached results; may be null.
- Throws:
HibernateException
- Indicates a problem delegating to the underlying cache.
-
-