org.hibernate.cache
Class StandardQueryCache

java.lang.Object
  extended by org.hibernate.cache.StandardQueryCache
All Implemented Interfaces:
QueryCache

public class StandardQueryCache
extends 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.

Author:
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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StandardQueryCache

public StandardQueryCache(Settings settings,
                          Properties props,
                          UpdateTimestampsCache updateTimestampsCache,
                          String regionName)
                   throws HibernateException
Throws:
HibernateException
Method Detail

clear

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

put

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

get

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

isUpToDate

protected boolean isUpToDate(Set spaces,
                             Long timestamp)

destroy

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

getRegion

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

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.