Top Description Methods
org.hibernate.cache.spi

public Interface QueryResultsCache

extends QueryCache
Known Direct Implementers
org.hibernate.cache.internal.QueryResultsCacheImpl
Imports
java.io.Serializable, java.util.List, .Set, org.hibernate.HibernateException, org.hibernate.cache.CacheException, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.type.Type

Deprecated

as a consequence of QueryCache being deprecated. See corresponding docs for further information.

Defines the responsibility for managing query result data caching in regards to a specific region.
Authors
Gavin King, Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public default void
clear()

Implements org.hibernate.cache.spi.QueryCache.clear.

Clear items from the query cache.
public default void
destroy()

Implements org.hibernate.cache.spi.QueryCache.destroy.

Destroy the cache.
public List<E>

Returns:

The cached results; may be null.
get
(QueryKey
The cache key
key
,
Set<Serializable>
The query spaces (used in invalidation plus validation checks)
spaces
,
Type[] returnTypes, SharedSessionContractImplementor
The originating session
session
)

Get results from the cache.

public List<E>

Returns:

The cached results; may be null.
get
(QueryKey
The cache key
key
,
String[]
The query spaces (used in invalidation plus validation checks)
spaces
,
Type[] returnTypes, SharedSessionContractImplementor
The originating session
session
)

Get results from the cache.

public default List<E>
get(QueryKey
The cache key
key
,
Type[]
The result types
returnTypes
,
boolean
Was this a natural id lookup?
isNaturalKeyLookup
,
Set<Serializable>
The query spaces (used in invalidation plus validation checks)
spaces
,
SharedSessionContractImplementor
The originating session
session
)

Implements org.hibernate.cache.spi.QueryCache.get.

Get results from the cache.
public QueryResultsRegion
getRegion()

Redeclares org.hibernate.cache.spi.QueryCache.getRegion.

The underlying cache region being used.
public boolean

Returns:

Whether the put actually happened.
put
(QueryKey
The cache key
key
,
List<E>
The results to cache
result
,
Type[] returnTypes, SharedSessionContractImplementor
The originating session
session
)

Put a result into the query cache.

public default boolean
put(QueryKey
The cache key
key
,
Type[]
The result types
returnTypes
,
List<E>
The results to cache
result
,
boolean
Was this a natural id lookup?
isNaturalKeyLookup
,
SharedSessionContractImplementor
The originating session
session
)

Implements org.hibernate.cache.spi.QueryCache.put.

Put a result into the query cache.

Method Detail

clearback to summary
public default void clear() throws CacheException

Implements org.hibernate.cache.spi.QueryCache.clear.

Clear items from the query cache.

Annotations
@Override
Exceptions
CacheException:
Indicates a problem delegating to the underlying cache.
destroyback to summary
public default void destroy()

Implements org.hibernate.cache.spi.QueryCache.destroy.

Doc from org.hibernate.cache.spi.QueryCache.destroy.

Destroy the cache.

Annotations
@Override
getback to summary
public List<E> get(QueryKey key, Set<Serializable> spaces, Type[] returnTypes, SharedSessionContractImplementor session) throws HibernateException

Get results from the cache.

Parameters
key:QueryKey

The cache key

spaces:Set<Serializable>

The query spaces (used in invalidation plus validation checks)

session:SharedSessionContractImplementor

The originating session

Returns:List<E>

The cached results; may be null.

Exceptions
HibernateException:
Indicates a problem delegating to the underlying cache.
getback to summary
public List<E> get(QueryKey key, String[] spaces, Type[] returnTypes, SharedSessionContractImplementor session) throws HibernateException

Get results from the cache.

Parameters
key:QueryKey

The cache key

spaces:String[]

The query spaces (used in invalidation plus validation checks)

session:SharedSessionContractImplementor

The originating session

Returns:List<E>

The cached results; may be null.

Exceptions
HibernateException:
Indicates a problem delegating to the underlying cache.
getback to summary
public default List<E> get(QueryKey key, Type[] returnTypes, boolean isNaturalKeyLookup, Set<Serializable> spaces, SharedSessionContractImplementor session)

Implements org.hibernate.cache.spi.QueryCache.get.

Doc from org.hibernate.cache.spi.QueryCache.get.

Get results from the cache.

Parameters
key:QueryKey

The cache key

returnTypes:Type[]

The result types

isNaturalKeyLookup:boolean

Was this a natural id lookup?

spaces:Set<Serializable>

The query spaces (used in invalidation plus validation checks)

session:SharedSessionContractImplementor

The originating session

Returns:List<E>

The cached results; may be null.

Annotations
@Override
getRegionback to summary
public QueryResultsRegion getRegion()

Redeclares org.hibernate.cache.spi.QueryCache.getRegion.

The underlying cache region being used.

Returns:QueryResultsRegion

Doc from org.hibernate.cache.spi.QueryCache.getRegion.

The cache region.

Annotations
@Override
putback to summary
public boolean put(QueryKey key, List<E> result, Type[] returnTypes, SharedSessionContractImplementor session) throws HibernateException

Put a result into the query cache.

Parameters
key:QueryKey

The cache key

result:List<E>

The results to cache

session:SharedSessionContractImplementor

The originating session

Returns:boolean

Whether the put actually happened.

Exceptions
HibernateException:
Indicates a problem delegating to the underlying cache.
putback to summary
public default boolean put(QueryKey key, Type[] returnTypes, List<E> result, boolean isNaturalKeyLookup, SharedSessionContractImplementor session)

Implements org.hibernate.cache.spi.QueryCache.put.

Doc from org.hibernate.cache.spi.QueryCache.put.

Put a result into the query cache.

Parameters
key:QueryKey

The cache key

returnTypes:Type[]

The result types

result:List<E>

The results to cache

isNaturalKeyLookup:boolean

Was this a natural id lookup?

session:SharedSessionContractImplementor

The originating session

Returns:boolean

Whether the put actually happened.

Annotations
@Override