2.12.0: 2009-05-27

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

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

public class DataQueryWrapper
extends Object
implements QueryWrapper<BasicData>

A query wrapper for DataQuery:s.

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

Field Summary
private  DbControl dc
           
private  Item itemType
           
private  Metadata metadata
           
private  DataQuery<BasicData> query
           
 
Constructor Summary
DataQueryWrapper(DbControl dc, DataQuery<BasicData> query, Item itemType, String entityName)
          Create a new query wrapper.
 
Method Summary
 Object getData(ExportedProperty exportedProperty, BasicData item)
          Uses a Metadata object to get the value of the specified property.
 int getId(BasicData item)
          Calls BasicData.getId()
 ResultIterator<BasicData> iterate()
          Calls DataQuery.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 DataQuery<BasicData> query

dc

private final DbControl dc

itemType

private final Item itemType

metadata

private final Metadata metadata
Constructor Detail

DataQueryWrapper

public DataQueryWrapper(DbControl dc,
                        DataQuery<BasicData> query,
                        Item itemType,
                        String entityName)
Create a new query wrapper.

Parameters:
dc - The DbControl used to execute the query
query - The query
itemType - Type of the items returned by the query
entityName - An optional entity name when retruning raw data
Method Detail

iterate

public ResultIterator<BasicData> iterate()
Calls DataQuery.iterate(DbControl)

Specified by:
iterate in interface QueryWrapper<BasicData>

getId

public int getId(BasicData item)
Calls BasicData.getId()

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

getData

public Object getData(ExportedProperty exportedProperty,
                      BasicData item)
Uses a Metadata object to get the value of the specified property.

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

2.12.0: 2009-05-27