Top Description Inners Fields Constructors Methods
org.hibernate.cache.internal

public Class QueryResultsCacheImpl

extends Object
implements QueryResultsCache
Class Inheritance
All Implemented Interfaces
org.hibernate.cache.spi.QueryResultsCache, org.hibernate.cache.spi.QueryCache
Imports
java.io.Serializable, java.util.ArrayList, .List, .Set, org.hibernate.HibernateException, org.hibernate.cache.spi.QueryKey, .QueryResultsCache, .QueryResultsRegion, .QuerySpacesHelper, .TimestampsCache, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.internal.util.collections.CollectionHelper, org.hibernate.type.Type, .TypeHelper

Deprecated

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

The standard implementation of the Hibernate QueryCache interface. Works hind-in-hand with TimestampsCache to help in recognizing stale query results.
Authors
Gavin King, Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final QueryResultsRegion
private static final CoreMessageLogger
private final TimestampsCache
timestampsCache

Deprecated as a consequence of TimestampsCache being deprecated.

Constructor Summary

AccessConstructor and Description
pack-priv
QueryResultsCacheImpl(QueryResultsRegion cacheRegion, TimestampsCache timestampsCache)

Deprecated as a consequence of TimestampsCache being deprecated.

Method Summary

Modifier and TypeMethod and Description
private List<E>
assembleCachedResult(final QueryKey key, final List<E> cached, boolean singleResult, final Type[] returnTypes, final SharedSessionContractImplementor session)

public List<E>
get(QueryKey
The cache key
key
,
Set<Serializable>
The query spaces (used in invalidation plus validation checks)
spaces
,
final Type[] returnTypes, SharedSessionContractImplementor
The originating session
session
)

Implements org.hibernate.cache.spi.QueryResultsCache.get.

Get results from the cache.
public List<E>
get(final QueryKey
The cache key
key
,
final String[]
The query spaces (used in invalidation plus validation checks)
spaces
,
final Type[] returnTypes, final SharedSessionContractImplementor
The originating session
session
)

Implements org.hibernate.cache.spi.QueryResultsCache.get.

Get results from the cache.
private QueryResultsCacheImpl.CacheItem
public QueryResultsRegion
getRegion()

Implements org.hibernate.cache.spi.QueryResultsCache.getRegion.

The underlying cache region being used.
private static void
logCachedResultDetails(QueryKey key, Set<E> querySpaces, Type[] returnTypes, List<E> result)

private static void
logCachedResultRowDetails(Type[] returnTypes, Object result)

private static void
logCachedResultRowDetails(Type[] returnTypes, Object[] tuple)

public boolean
put(final QueryKey
The cache key
key
,
final List<E>
The results to cache
results
,
final Type[] returnTypes, final SharedSessionContractImplementor
The originating session
session
)

Implements org.hibernate.cache.spi.QueryResultsCache.put.

Put a result into the query cache.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

cacheRegionback to summary
private final QueryResultsRegion cacheRegion
LOGback to summary
private static final CoreMessageLogger LOG
timestampsCacheback to summary
private final TimestampsCache timestampsCache

Deprecated

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

Constructor Detail

QueryResultsCacheImplback to summary
pack-priv QueryResultsCacheImpl(QueryResultsRegion cacheRegion, TimestampsCache timestampsCache)

Deprecated

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

Method Detail

assembleCachedResultback to summary
private List<E> assembleCachedResult(final QueryKey key, final List<E> cached, boolean singleResult, final Type[] returnTypes, final SharedSessionContractImplementor session) throws HibernateException
Annotations
@SuppressWarnings:unchecked
getback to summary
public List<E> get(QueryKey key, Set<Serializable> spaces, final Type[] returnTypes, SharedSessionContractImplementor session)

Implements org.hibernate.cache.spi.QueryResultsCache.get.

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

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.

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

Implements org.hibernate.cache.spi.QueryResultsCache.get.

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

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.

Annotations
@Override
@SuppressWarnings:unchecked
getCachedDataback to summary
private QueryResultsCacheImpl.CacheItem getCachedData(QueryKey key, SharedSessionContractImplementor session)
getRegionback to summary
public QueryResultsRegion getRegion()

Implements org.hibernate.cache.spi.QueryResultsCache.getRegion.

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

The underlying cache region being used.

Returns:QueryResultsRegion

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

The cache region.

Annotations
@Override
logCachedResultDetailsback to summary
private static void logCachedResultDetails(QueryKey key, Set<E> querySpaces, Type[] returnTypes, List<E> result)
logCachedResultRowDetailsback to summary
private static void logCachedResultRowDetails(Type[] returnTypes, Object result)
logCachedResultRowDetailsback to summary
private static void logCachedResultRowDetails(Type[] returnTypes, Object[] tuple)
putback to summary
public boolean put(final QueryKey key, final List<E> results, final Type[] returnTypes, final SharedSessionContractImplementor session) throws HibernateException

Implements org.hibernate.cache.spi.QueryResultsCache.put.

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

Put a result into the query cache.

Parameters
key:QueryKey

The cache key

results:List<E>

The results to cache

session:SharedSessionContractImplementor

The originating session

Returns:boolean

Whether the put actually happened.

Annotations
@Override
@SuppressWarnings:unchecked
Exceptions
HibernateException:
Indicates a problem delegating to the underlying cache.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.hibernate.cache.internal back to summary

public Class QueryResultsCacheImpl.CacheItem

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable

Field Summary

Modifier and TypeField and Description
private final List<E>
private final long

Constructor Summary

AccessConstructor and Description
pack-priv
CacheItem(long timestamp, List<E> results)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

resultsback to summary
private final List<E> results
timestampback to summary
private final long timestamp

Constructor Detail

CacheItemback to summary
pack-priv CacheItem(long timestamp, List<E> results)