2.17.2: 2011-06-17

net.sf.basedb.clients.web.plugins
Class DynamicQueryWrapper

java.lang.Object
  extended by net.sf.basedb.clients.web.plugins.DynamicQueryWrapper
All Implemented Interfaces:
DataLoader<SqlResult>, QueryWrapper<SqlResult>

public class DynamicQueryWrapper
extends Object
implements QueryWrapper<SqlResult>

A query wrapper for DynamicQuery:s.

Version:
2.2
Author:
nicklas
Last modified
$Date: 2008-09-11 22:05:50 +0200 (Thu, 11 Sep 2008) $

Field Summary
private  int colIndex
           
private  int counter
           
private  DbControl dc
           
private  DynamicQuery query
           
 
Constructor Summary
DynamicQueryWrapper(DbControl dc, DynamicQuery query)
          Create a new query wrapper.
 
Method Summary
 Object getData(ExportedProperty exportedProperty, SqlResult item)
          Calls SqlResult.getObject(int) and increases the column index for each call.
 int getId(SqlResult item)
          Keeps a counter which is incremented at each call to this method.
 ResultIterator<SqlResult> iterate()
          Calls AbstractSqlQuery.iterate(DbControl)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

query

private final DynamicQuery query

dc

private final DbControl dc

counter

private int counter

colIndex

private int colIndex
Constructor Detail

DynamicQueryWrapper

public DynamicQueryWrapper(DbControl dc,
                           DynamicQuery query)
Create a new query wrapper.

Parameters:
dc - The DbControl used to execute the query
query - The query
Method Detail

iterate

public ResultIterator<SqlResult> iterate()
Calls AbstractSqlQuery.iterate(DbControl)

Specified by:
iterate in interface QueryWrapper<SqlResult>

getId

public int getId(SqlResult item)
Keeps a counter which is incremented at each call to this method. Starts at 0.

Specified by:
getId in interface QueryWrapper<SqlResult>
Parameters:
item - The item

getData

public Object getData(ExportedProperty exportedProperty,
                      SqlResult item)
               throws SQLException
Calls SqlResult.getObject(int) and increases the column index for each call. Expects this method to be called in the order the properties are selected.

Specified by:
getData in interface DataLoader<SqlResult>
Parameters:
exportedProperty - The property to get the value for
item - The item that holds the value
Throws:
SQLException

2.17.2: 2011-06-17