Report Query
From BluWiki
Report Query return an iterator object.
When the needed field is very small, we do not need to retrieve whole row from DB, so under this situation, we use report query.
// How to call following method. Region.java
//Iterator partOfItems = pb.getReportQueryIteratorByQuery(getRQByCritForNotificationData);
public ReportQueryByCriteria getRQByCritForNotificationData(Class target, Integer notificationInformationId, Date sendDate)
{
if (notificationInformationId == null || sendDate == null)
{
return null;
}
Criteria crit = new Criteria();
crit.addEqualTo("i_notificationInformationId", notificationInformationId);
crit.addEqualTo("i_sendDate", sendDate);;
ReportQueryByCriteria qr = new ReportQueryByCriteria(target, crit);
qr.setAttributes(new String[] {"data"});
return qr;
}
.................................................................................................................................
private Iterator getObjectByReportQuery(PersistenceBroker pb,CustomView cv, Class target, Integer ID, Date sendDate) {
/*
ReportQueryByCriteria qr = QueryFactory.newReportQuery(CheeseItem.class, crit);
qr.setAttributes(new String[] {"weight"});
*/
ReportQueryByCriteria qr = new CustomView().getRQByCritForNotificationData(target, ID, sendDate);
Iterator partOfItems = pb.getReportQueryIteratorByQuery(qr);
return partOfItems;
}






