public interface QueryCache
Defines the contract for caches capable of storing query results. These caches should only concern themselves with storing the matching result ids. The transactional semantics are necessarily less strict than the semantics of an item cache.
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear items from the query cache.
|
void |
destroy()
Destroy the cache.
|
List |
get(QueryKey key,
Type[] returnTypes,
boolean isNaturalKeyLookup,
Set<Serializable> spaces,
SharedSessionContractImplementor session)
Get results from the cache.
|
QueryResultsRegion |
getRegion()
The underlying cache factory region being used.
|
boolean |
put(QueryKey key,
Type[] returnTypes,
List result,
boolean isNaturalKeyLookup,
SharedSessionContractImplementor session)
Put a result into the query cache.
|
void clear() throws CacheException
Clear items from the query cache.
CacheException
- Indicates a problem delegating to the underlying cache.boolean put(QueryKey key, Type[] returnTypes, List result, boolean isNaturalKeyLookup, SharedSessionContractImplementor session) throws HibernateException
Put a result into the query cache.
key
- The cache keyreturnTypes
- The result typesresult
- The results to cacheisNaturalKeyLookup
- Was this a natural id lookup?session
- The originating sessionHibernateException
- Indicates a problem delegating to the underlying cache.List get(QueryKey key, Type[] returnTypes, boolean isNaturalKeyLookup, Set<Serializable> spaces, SharedSessionContractImplementor session) throws HibernateException
Get results from the cache.
key
- The cache keyreturnTypes
- The result typesisNaturalKeyLookup
- Was this a natural id lookup?spaces
- The query spaces (used in invalidation plus validation checks)session
- The originating sessionHibernateException
- Indicates a problem delegating to the underlying cache.void destroy()
Destroy the cache.
QueryResultsRegion getRegion()
The underlying cache factory region being used.
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.