org.melati.poem
Class CachedQuery

Package class diagram package CachedQuery
java.lang.Object
  extended by org.melati.poem.CachedQuery
Direct Known Subclasses:
CachedCount, CachedSelection

public abstract class CachedQuery
extends Object

Object to return the results of a query with caching.

Cached results will be returned unless the relevant tables have been updated since the query was last executed, in which case the results will be recomputed.


Field Summary
protected  Vector<Integer> rows
           
protected  PreparedStatementFactory statements
           
protected  Table table
           
 
Constructor Summary
CachedQuery(Table table, String query, Table[] otherTables)
          Constructor.
 
Method Summary
protected  void compute()
           
protected  Object extract(ResultSet rs)
           
 Table getTable()
           
protected  void setQuery(String query)
          Used in constructor of CachedSelection.
protected  PreparedStatementFactory statements()
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

statements

protected PreparedStatementFactory statements

rows

protected Vector<Integer> rows

table

protected Table table
Constructor Detail

CachedQuery

public CachedQuery(Table table,
                   String query,
                   Table[] otherTables)
Constructor.

Parameters:
table - the table to select from
query - the SQL query string
otherTables - an array of other tables involved in the query
Method Detail

statements

protected PreparedStatementFactory statements()

extract

protected Object extract(ResultSet rs)
                  throws SQLException
Throws:
SQLException

compute

protected void compute()

getTable

public Table getTable()
Returns:
the table property

setQuery

protected void setQuery(String query)
Used in constructor of CachedSelection.

Parameters:
query - the query to set

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2000-2010 PanEris. All Rights Reserved.