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 for
DynamicQuery
:s.- Version:
- 2.2
- Author:
- nicklas
- Last modified
- $Date: 2012-09-14 12:29:16 +0200 (fr, 14 sep 2012) $
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DynamicQueryWrapper(SqlQuery query)
Create a new query wrapper. -
Method Summary
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 Details
-
query
-
counter
private int counter -
colIndex
private int colIndex
-
-
Constructor Details
-
DynamicQueryWrapper
Create a new query wrapper.- Parameters:
query
- The query
-
-
Method Details
-
iterate
- Specified by:
iterate
in interfaceQueryWrapper<SqlResult>
-
getId
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 SQLExceptionCallsSqlResult.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
-