public class StandardQueryCache extends Object implements QueryCache
Constructor and Description |
---|
StandardQueryCache(SessionFactoryOptions settings,
Properties props,
UpdateTimestampsCache updateTimestampsCache,
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.
|
List |
get(QueryKey key,
Type[] returnTypes,
boolean isNaturalKeyLookup,
Set<Serializable> spaces,
SessionImplementor session)
Get results from the cache.
|
QueryResultsRegion |
getRegion()
The underlying cache factory region being used.
|
protected boolean |
isUpToDate(Set<Serializable> spaces,
Long timestamp,
SessionImplementor session) |
boolean |
put(QueryKey key,
Type[] returnTypes,
List result,
boolean isNaturalKeyLookup,
SessionImplementor session)
Put a result into the query cache.
|
String |
toString() |
public StandardQueryCache(SessionFactoryOptions settings, Properties props, UpdateTimestampsCache updateTimestampsCache, String regionName)
settings
- The SessionFactory settings.props
- Any propertiesupdateTimestampsCache
- The update-timestamps cache to use.regionName
- The base query cache region namepublic 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, List result, boolean isNaturalKeyLookup, SessionImplementor 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 List get(QueryKey key, Type[] returnTypes, boolean isNaturalKeyLookup, Set<Serializable> spaces, SessionImplementor 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(Set<Serializable> spaces, Long timestamp, SessionImplementor session)
Copyright © 2017 JBoss by Red Hat. All rights reserved.