Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javatools.db
Class DbCachedTable  view DbCachedTable download DbCachedTable.java

java.lang.Object
  extended byjavatools.db.AbstractTable
      extended byjavatools.db.DbAbstractTable
          extended byjavatools.db.DbTable
              extended byjavatools.db.DbCachedTable
All Implemented Interfaces:
DbResult, DbTableUser

public class DbCachedTable
extends DbTable

It's a "cached" table, that represents a result from SELECT in a cached way, that is it can be accessed more than once.

Version:
0.0.1

Field Summary
protected  java.util.LinkedList resultList
          Contains the result list as a linked list instead of a result set.
 
Fields inherited from class javatools.db.DbTable
columnCount, columns, db, defaultValues, rs, stmt
 
Fields inherited from class javatools.db.AbstractTable
colNameMap, displaySize, names, tableName, types
 
Constructor Summary
DbCachedTable(DbDatabase db)
          Creates new DbCachedTable
 
Method Summary
 DbIterator iterator()
          Return an iterator to iterate over the rows in this table.
 void setResultSet(java.sql.PreparedStatement stmt, java.sql.ResultSet rs)
          Sets the result set to be representend in this class.
 
Methods inherited from class javatools.db.DbTable
close, finalize, getAddColumn, getColumn, getColumn, getColumnCount, getConstraint, getDatabase, getDefault, getDefault, getFullTableName, setTableName
 
Methods inherited from class javatools.db.DbAbstractTable
deleter, inserter, inserter, simpleDeleter, simpleInserter, simpleInserter, simpleUpdater, updater
 
Methods inherited from class javatools.db.AbstractTable
equals, getColumnIndex, getColumnName, setColumnCount, setColumnName, usesTables
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resultList

protected java.util.LinkedList resultList
Contains the result list as a linked list instead of a result set.

Constructor Detail

DbCachedTable

public DbCachedTable(DbDatabase db)
              throws DbException
Creates new DbCachedTable

Method Detail

iterator

public DbIterator iterator()
Return an iterator to iterate over the rows in this table.

BUGS: Currently you can only iterate over a table that was returned from a DbSelector.

Specified by:
iterator in interface DbResult
Overrides:
iterator in class DbTable

setResultSet

public void setResultSet(java.sql.PreparedStatement stmt,
                         java.sql.ResultSet rs)
                  throws DbException
Sets the result set to be representend in this class.

Overrides:
setResultSet in class DbTable