org.hibernate.cache

Class StandardQueryCache

Implemented Interfaces:
QueryCache

public class StandardQueryCache
extends java.lang.Object
implements QueryCache

The standard implementation of the Hibernate QueryCache interface. This implementation is very good at recognizing stale query results and and re-running queries when it detects this condition, recaching the new results.
Authors:
Gavin King
Steve Ebersole

Constructor Summary

StandardQueryCache(Settings settings, Properties props, UpdateTimestampsCache updateTimestampsCache, String regionName)

Method Summary

void
clear()
void
destroy()
List
get(QueryKey key, Type[] returnTypes, boolean isNaturalKeyLookup, Set spaces, SessionImplementor session)
QueryResultsRegion
getRegion()
protected boolean
isUpToDate(Set spaces, Long timestamp)
boolean
put(QueryKey key, Type[] returnTypes, List result, boolean isNaturalKeyLookup, SessionImplementor session)
String
toString()

Constructor Details

StandardQueryCache

public StandardQueryCache(Settings settings,
                          Properties props,
                          UpdateTimestampsCache updateTimestampsCache,
                          String regionName)
            throws HibernateException

Method Details

clear

public void clear()
            throws CacheException
Specified by:
clear in interface QueryCache

destroy

public void destroy()
Specified by:
destroy in interface QueryCache

get

public List get(QueryKey key,
                Type[] returnTypes,
                boolean isNaturalKeyLookup,
                Set spaces,
                SessionImplementor session)
            throws HibernateException
Specified by:
get in interface QueryCache

getRegion

public QueryResultsRegion getRegion()
Specified by:
getRegion in interface QueryCache

isUpToDate

protected boolean isUpToDate(Set spaces,
                             Long timestamp)

put

public boolean put(QueryKey key,
                   Type[] returnTypes,
                   List result,
                   boolean isNaturalKeyLookup,
                   SessionImplementor session)
            throws HibernateException
Specified by:
put in interface QueryCache

toString

public String toString()