Package org.hibernate.cache.spi
Interface QueryResultsCache
- All Known Implementing Classes:
QueryResultsCacheImpl
public interface QueryResultsCache
Responsible for managing query result list caching in a specific
query cache region. There may be
multiple instances of
QueryResultsCache, corresponding to
second-level cache regions with distinct policies.
A QueryResultsCache depends on the TimestampsCache
to track invalidation of the query spaces (tables) which affect the
cached queries. A cached query result list is considered stale
if any one of the query spaces which affect the query results was
invalidated since the result
list was read from the database and stored in the
query result cache.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclear()Clear all items from this query result cache.default voiddestroy()List<?> get(QueryKey key, String[] spaces, SharedSessionContractImplementor session) Attempt to retrieve a cached query result list for the givenQueryKeyfrom the cache region, and then check if the cached results, if any, are stale.List<?> get(QueryKey key, Set<String> spaces, SharedSessionContractImplementor session) Attempt to retrieve a cached query result list for the givenQueryKeyfrom the cache region, and then check if the cached results, if any, are stale.The underlying cache region being used.booleanput(QueryKey key, List<?> result, SharedSessionContractImplementor session) Store a result list of a query with the givenQueryKeyin the query result cache.
-
Method Details
-
getRegion
QueryResultsRegion getRegion()The underlying cache region being used. -
clear
Clear all items from this query result cache.- Throws:
CacheException- Indicates a problem delegating to the underlying cache.
-
destroy
default void destroy()
-