Class DynamicQueryWrapper
- java.lang.Object
-
- 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 forDynamicQuery
:s.- Version:
- 2.2
- Author:
- nicklas
- Last modified
- $Date: 2012-09-14 12:29:16 +0200 (fr, 14 sep 2012) $
-
-
Constructor Summary
Constructors Constructor Description DynamicQueryWrapper(SqlQuery query)
Create a new query wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getData(DbControl dc, ExportedProperty exportedProperty, SqlResult item)
CallsSqlResult.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(DbControl dc)
-
-
-
Field Detail
-
query
private final SqlQuery query
-
counter
private int counter
-
colIndex
private int colIndex
-
-
Constructor Detail
-
DynamicQueryWrapper
public DynamicQueryWrapper(SqlQuery query)
Create a new query wrapper.- Parameters:
query
- The query
-
-
Method Detail
-
iterate
public ResultIterator<SqlResult> iterate(DbControl dc)
- Specified by:
iterate
in interfaceQueryWrapper<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 interfaceQueryWrapper<SqlResult>
- Parameters:
item
- The item
-
getData
public Object getData(DbControl dc, ExportedProperty exportedProperty, SqlResult item) throws SQLException
CallsSqlResult.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 interfaceDataLoader<SqlResult>
exportedProperty
- The property to get the value foritem
- The item that holds the value- Throws:
SQLException
-
-