本文整理汇总了Java中org.apache.ojb.broker.PersistenceBroker.getReportQueryIteratorByQuery方法的典型用法代码示例。如果您正苦于以下问题:Java PersistenceBroker.getReportQueryIteratorByQuery方法的具体用法?Java PersistenceBroker.getReportQueryIteratorByQuery怎么用?Java PersistenceBroker.getReportQueryIteratorByQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ojb.broker.PersistenceBroker
的用法示例。
在下文中一共展示了PersistenceBroker.getReportQueryIteratorByQuery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPositionAssociatedWithFundingLock
import org.apache.ojb.broker.PersistenceBroker; //导入方法依赖的package包/类
/**
* @see org.kuali.kfs.module.bc.document.dataaccess.BudgetConstructionDao#getPositionAssociatedWithFundingLock(org.kuali.kfs.module.bc.businessobject.BudgetConstructionFundingLock)
*/
public String getPositionAssociatedWithFundingLock(BudgetConstructionFundingLock budgetConstructionFundingLock) {
String positionNumber = BCConstants.POSITION_NUMBER_NOT_FOUND; // default if there is no associated position that is locked
// (orphaned)
Criteria criteria = new Criteria();
criteria.addEqualTo("pendingBudgetConstructionAppointmentFunding.chartOfAccountsCode", budgetConstructionFundingLock.getChartOfAccountsCode());
criteria.addEqualTo("pendingBudgetConstructionAppointmentFunding.accountNumber", budgetConstructionFundingLock.getAccountNumber());
criteria.addEqualTo("pendingBudgetConstructionAppointmentFunding.subAccountNumber", budgetConstructionFundingLock.getSubAccountNumber());
criteria.addEqualTo("pendingBudgetConstructionAppointmentFunding.universityFiscalYear", budgetConstructionFundingLock.getUniversityFiscalYear());
criteria.addEqualTo("positionLockUserIdentifier", budgetConstructionFundingLock.getAppointmentFundingLockUserId());
String[] columns = new String[] { "positionNumber" };
ReportQueryByCriteria q = QueryFactory.newReportQuery(BudgetConstructionPosition.class, columns, criteria, true);
PersistenceBroker pb = getPersistenceBroker(true);
Iterator<Object[]> iter = pb.getReportQueryIteratorByQuery(q);
if (iter.hasNext()) {
Object[] objs = TransactionalServiceUtils.retrieveFirstAndExhaustIterator(iter);
if (objs[0] != null) {
positionNumber = (String) objs[0];
}
}
return positionNumber;
}