public class StandardQueryCache extends java.lang.Object implements QueryCache
Constructor and Description |
---|
StandardQueryCache(QueryResultsRegion cacheRegion,
CacheImplementor cacheManager) |
StandardQueryCache(SessionFactoryOptions settings,
java.util.Properties props,
UpdateTimestampsCache updateTimestampsCache,
java.lang.String regionName)
Constructs a StandardQueryCache instance
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear items from the query cache.
|
void |
destroy()
Destroy the cache.
|
java.util.List |
get(QueryKey key,
Type[] returnTypes,
boolean isNaturalKeyLookup,
java.util.Set<java.io.Serializable> spaces,
SharedSessionContractImplementor session)
Get results from the cache.
|
QueryResultsRegion |
getRegion()
The underlying cache factory region being used.
|
protected boolean |
isUpToDate(java.util.Set<java.io.Serializable> spaces,
java.lang.Long timestamp,
SharedSessionContractImplementor session) |
boolean |
put(QueryKey key,
Type[] returnTypes,
java.util.List result,
boolean isNaturalKeyLookup,
SharedSessionContractImplementor session)
Put a result into the query cache.
|
java.lang.String |
toString() |
public StandardQueryCache(SessionFactoryOptions settings, java.util.Properties props, UpdateTimestampsCache updateTimestampsCache, java.lang.String regionName)
settings
- The SessionFactory settings.props
- Any propertiesupdateTimestampsCache
- The update-timestamps cache to use.regionName
- The base query cache region namepublic StandardQueryCache(QueryResultsRegion cacheRegion, CacheImplementor cacheManager)
public QueryResultsRegion getRegion()
QueryCache
getRegion
in interface QueryCache
public void destroy()
QueryCache
destroy
in interface QueryCache
public void clear() throws CacheException
QueryCache
clear
in interface QueryCache
CacheException
- Indicates a problem delegating to the underlying cache.public boolean put(QueryKey key, Type[] returnTypes, java.util.List result, boolean isNaturalKeyLookup, SharedSessionContractImplementor session) throws HibernateException
QueryCache
put
in interface QueryCache
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.public java.util.List get(QueryKey key, Type[] returnTypes, boolean isNaturalKeyLookup, java.util.Set<java.io.Serializable> spaces, SharedSessionContractImplementor session) throws HibernateException
QueryCache
get
in interface QueryCache
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.protected boolean isUpToDate(java.util.Set<java.io.Serializable> spaces, java.lang.Long timestamp, SharedSessionContractImplementor session)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.