public class DynamicQueryWrapper extends java.lang.Object implements QueryWrapper<SqlResult>
DynamicQuery
:s.Modifier and Type | Field and Description |
---|---|
private int |
colIndex |
private int |
counter |
private SqlQuery |
query |
Constructor and Description |
---|
DynamicQueryWrapper(SqlQuery query)
Create a new query wrapper.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getData(DbControl dc,
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(DbControl dc)
|
private final SqlQuery query
private int counter
private int colIndex
public DynamicQueryWrapper(SqlQuery query)
query
- The querypublic ResultIterator<SqlResult> iterate(DbControl dc)
iterate
in interface QueryWrapper<SqlResult>
public int getId(SqlResult item)
getId
in interface QueryWrapper<SqlResult>
item
- The itempublic java.lang.Object getData(DbControl dc, ExportedProperty exportedProperty, SqlResult item) throws java.sql.SQLException
SqlResult.getObject(int)
and increases the column index
for each call. Expects this method to be called in the order the properties
are selected.getData
in interface DataLoader<SqlResult>
exportedProperty
- The property to get the value foritem
- The item that holds the valuejava.sql.SQLException