Log in / create account Article Discussion Edit History Go to the site toolbox

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;
  }




Site Toolbox:

Personal tools
GNU Free Documentation License 1.2
This page was last modified 22:32, 7 February 2007. - This page has been accessed 395 times. - Disclaimers - About BluWiki
honeypot