gnu.beanfactory.jdbc
Class CachedQuery

java.lang.Object
  |
  +--gnu.beanfactory.jdbc.Query
        |
        +--gnu.beanfactory.jdbc.CachedQuery

public class CachedQuery
extends Query

Query implementation with caching behavior. Instances of CachedQuery will not cache unless the cacheTTL and cacheRowCountMax threshold values are set.
propertyNamedescriptionrequired?
connectionPoolURL reference to a ConnectionPooltrue
dataBeanClassFully qualified class name of the data beantrue
sqlselect SQL statementtrue
propertyMapProperties cotaining columnName to propertyName mappingsfalse
cacheTTLMax # of seconds a cached result can remain in the cache before becoming stale. Default: -1 (Will not allow cached entries.false)
cacheRowCountMaxMaximum number of result set rows that can be in the cache. Default: 0 (Will not allow cached entries)false


Inner classes inherited from class gnu.beanfactory.jdbc.Query
Query.CacheKey
 
Constructor Summary
CachedQuery()
           
 
Method Summary
protected  void cacheResults(Query.CacheKey key, java.lang.Object[] results)
           
protected  void flushCache()
           
protected  void flushCache(Query.CacheKey key)
           
 long getCacheRowCount()
           
 long getCacheRowCountMax()
           
 long getCacheTTL()
           
protected  java.lang.Object[] getResultsFromCache(Query.CacheKey key)
           
 void setCacheRowCountMax(long l)
           
 void setCacheTTL(long l)
           
 
Methods inherited from class gnu.beanfactory.jdbc.Query
columnToPropertyName, doSelect, getConnectionPool, getDataBeanClass, getPropertyMap, getSql, newRowBean, select, select, select, selectFirst, selectFirst, selectFirst, selectFirstUncached, selectFirstUncached, selectFirstUncached, selectUncached, selectUncached, selectUncached, setConnectionPool, setDataBeanClass, setPropertyMap, setSql
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedQuery

public CachedQuery()
Method Detail

getCacheRowCountMax

public long getCacheRowCountMax()

setCacheRowCountMax

public void setCacheRowCountMax(long l)

getCacheTTL

public long getCacheTTL()

setCacheTTL

public void setCacheTTL(long l)

getCacheRowCount

public long getCacheRowCount()

cacheResults

protected void cacheResults(Query.CacheKey key,
                            java.lang.Object[] results)
Overrides:
cacheResults in class Query

getResultsFromCache

protected java.lang.Object[] getResultsFromCache(Query.CacheKey key)
Overrides:
getResultsFromCache in class Query

flushCache

protected void flushCache(Query.CacheKey key)
Overrides:
flushCache in class Query

flushCache

protected void flushCache()
Overrides:
flushCache in class Query