Package org.hibernate.cache.spi
Interface QueryResultsCache
-
- All Superinterfaces:
QueryCache
public interface QueryResultsCache extends QueryCache
Defines the responsibility for managing query result data caching in regards to a specific region.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclear()Clear items from the query cache.default voiddestroy()Destroy the cache.Listget(QueryKey key, String[] spaces, Type[] returnTypes, SharedSessionContractImplementor session)Get results from the cache.Listget(QueryKey key, Set<Serializable> spaces, Type[] returnTypes, SharedSessionContractImplementor session)Get results from the cache.default Listget(QueryKey key, Type[] returnTypes, boolean isNaturalKeyLookup, Set<Serializable> spaces, SharedSessionContractImplementor session)Get results from the cache.QueryResultsRegiongetRegion()The underlying cache region being used.booleanput(QueryKey key, List result, Type[] returnTypes, SharedSessionContractImplementor session)Put a result into the query cache.default booleanput(QueryKey key, Type[] returnTypes, List result, boolean isNaturalKeyLookup, SharedSessionContractImplementor session)Put a result into the query cache.
-
-
-
Method Detail
-
getRegion
QueryResultsRegion getRegion()
The underlying cache region being used.- Specified by:
getRegionin interfaceQueryCache- Returns:
- The cache region.
-
clear
default void clear() throws CacheExceptionClear items from the query cache.- Specified by:
clearin interfaceQueryCache- Throws:
CacheException- Indicates a problem delegating to the underlying cache.
-
put
boolean put(QueryKey key, List result, Type[] returnTypes, SharedSessionContractImplementor session) throws HibernateException
Put a result into the query cache.- Parameters:
key- The cache keyresult- The results to cachesession- The originating session- Returns:
- Whether the put actually happened.
- Throws:
HibernateException- Indicates a problem delegating to the underlying cache.
-
get
List get(QueryKey key, Set<Serializable> spaces, Type[] returnTypes, SharedSessionContractImplementor session) throws HibernateException
Get results from the cache.- 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
List get(QueryKey key, String[] spaces, Type[] returnTypes, SharedSessionContractImplementor session) throws HibernateException
Get results from the cache.- 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.
-
put
default boolean put(QueryKey key, Type[] returnTypes, List result, boolean isNaturalKeyLookup, SharedSessionContractImplementor session)
Description copied from interface:QueryCachePut a result into the query cache.- Specified by:
putin interfaceQueryCache- Parameters:
key- The cache keyreturnTypes- The result typesresult- The results to cacheisNaturalKeyLookup- Was this a natural id lookup?session- The originating session- Returns:
- Whether the put actually happened.
-
get
default List get(QueryKey key, Type[] returnTypes, boolean isNaturalKeyLookup, Set<Serializable> spaces, SharedSessionContractImplementor session)
Description copied from interface:QueryCacheGet results from the cache.- Specified by:
getin interfaceQueryCache- Parameters:
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 session- Returns:
- The cached results; may be null.
-
destroy
default void destroy()
Description copied from interface:QueryCacheDestroy the cache.- Specified by:
destroyin interfaceQueryCache
-
-