use of org.apache.ojb.broker.query.Criteria in project cu-kfs by CU-CommunityApps.
the class AccountGlobalSearchDaoOjb method getAccountsByOrgHierarchy.
public Collection getAccountsByOrgHierarchy(String chartOfAccountsCode, String organizationCode, Map<String, String> parameters) {
Criteria criteria = new Criteria();
Criteria orgCriteria = new Criteria();
orgCriteria.addEqualTo(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, chartOfAccountsCode);
orgCriteria.addEqualTo(KFSPropertyConstants.ORGANIZATION_CODE, organizationCode);
criteria.addOrCriteria(orgCriteria);
List<Organization> reportingOrgs = getReportingOrgs(chartOfAccountsCode, organizationCode, new HashSet<Organization>());
for (Organization reportingOrg : reportingOrgs) {
orgCriteria = new Criteria();
orgCriteria.addEqualTo(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, reportingOrg.getChartOfAccountsCode());
orgCriteria.addEqualTo(KFSPropertyConstants.ORGANIZATION_CODE, reportingOrg.getOrganizationCode());
criteria.addOrCriteria(orgCriteria);
}
// Add the rest of the criteria for the lookup
parameters.remove(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE);
parameters.remove(KFSPropertyConstants.ORGANIZATION_CODE);
criteria.addAndCriteria(lookupDao.getCollectionCriteriaFromMap(new Account(), parameters));
return getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(Account.class, criteria));
}
use of org.apache.ojb.broker.query.Criteria in project cu-kfs by CU-CommunityApps.
the class AccountReversionDaoOjb method getAccountReversionsByBudgetReversionAcount.
/**
* @see edu.cornell.kfs.coa.dataaccess.AccountReversionDao#getAccountReversionsByBudgetReversionAcount(java.lang.String, java.lang.String)
*/
@Override
public List<AccountReversion> getAccountReversionsByBudgetReversionAcount(String budgetReversionChartOfAccountsCode, String budgetReversionAccountNumber) {
LOG.debug("getAccountReversionsByBudgetReversionAcount() started");
Criteria criteria = new Criteria();
criteria.addEqualTo(CUKFSPropertyConstants.ACCT_REVERSION_BUDGET_REVERSION_CHART_OF_ACCT_CODE, budgetReversionChartOfAccountsCode);
criteria.addEqualTo(CUKFSPropertyConstants.ACCT_REVERSION_BUDGET_REVERSION_ACCT_NUMBER, budgetReversionAccountNumber);
criteria.addEqualTo(CUKFSPropertyConstants.ACCT_REVERSION_ACTIVE, true);
QueryByCriteria q = QueryFactory.newQuery(AccountReversion.class, criteria);
return (List) getPersistenceBrokerTemplate().getCollectionByQuery(q);
}
use of org.apache.ojb.broker.query.Criteria in project cu-kfs by CU-CommunityApps.
the class AccountReversionDaoOjb method getByPrimaryId.
/**
* @see org.kuali.kfs.coa.dataaccess.OrganizationReversionDao#getByPrimaryId(java.lang.Integer, java.lang.String,
* java.lang.String)
*/
public AccountReversion getByPrimaryId(Integer universityFiscalYear, String financialChartOfAccountsCode, String accountNumber) {
LOG.debug("getByPrimaryId() started");
Criteria criteria = new Criteria();
criteria.addEqualTo("universityFiscalYear", universityFiscalYear);
criteria.addEqualTo("chartOfAccountsCode", financialChartOfAccountsCode);
criteria.addEqualTo("accountNumber", accountNumber);
return (AccountReversion) getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(AccountReversion.class, criteria));
}
use of org.apache.ojb.broker.query.Criteria in project cu-kfs by CU-CommunityApps.
the class AchBundlerAdviceDaoObj method getAchPaymentDetailsNeedingAdviceNotificationByDisbursementNumber.
// KFSPTS--1460
/**
* Returns all PaymentDetail records needing ACH advice email notifications for a given disbursement number
*
* NOTE:
* This method was made transactional per fix described in KULRICE-6914 for the iterator no longer
* containing the data and iter.hasNext() causing a run time exception.
*
* @return an iterator of PaymentDetail records matching the given criteria
*/
@Transactional
public List<PaymentDetail> getAchPaymentDetailsNeedingAdviceNotificationByDisbursementNumber(Integer disbursementNumber) {
LOG.debug("getAchPaymentDetailsNeedingAdviceNotificationByDisbursementNumber() started");
Criteria criteria = new Criteria();
criteria.addEqualTo(PdpPropertyConstants.PaymentDetail.PAYMENT_GROUP + "." + PdpPropertyConstants.PaymentGroup.PAYMENT_GROUP_DISBURSEMENT_TYPE_CODE, PdpConstants.DisbursementTypeCodes.ACH);
criteria.addEqualTo(PdpPropertyConstants.PaymentDetail.PAYMENT_GROUP + "." + PdpPropertyConstants.PaymentGroup.PAYMENT_GROUP_PAYMENT_STATUS_CODE, PdpConstants.PaymentStatusCodes.EXTRACTED);
criteria.addEqualTo(PdpPropertyConstants.PaymentDetail.PAYMENT_GROUP + "." + PdpPropertyConstants.PaymentGroup.PAYMENT_GROUP_DISBURSEMENT_NBR, disbursementNumber);
criteria.addIsNull(PdpPropertyConstants.PaymentDetail.PAYMENT_GROUP + "." + PdpPropertyConstants.ADVICE_EMAIL_SENT_DATE);
QueryByCriteria paymentDetailsQuery = QueryFactory.newQuery(PaymentDetail.class, criteria);
List paymentDetailByDisbursementNumberList = (List) getPersistenceBrokerTemplate().getCollectionByQuery(paymentDetailsQuery);
DynamicCollectionComparator.sort(paymentDetailByDisbursementNumberList, PdpPropertyConstants.PaymentDetail.PAYMENT_DISBURSEMENT_FINANCIAL_DOCUMENT_TYPE_CODE, PdpPropertyConstants.PaymentDetail.PAYMENT_DISBURSEMENT_CUST_PAYMENT_DOC_NBR);
return paymentDetailByDisbursementNumberList;
}
use of org.apache.ojb.broker.query.Criteria in project cu-kfs by CU-CommunityApps.
the class AchBundlerAdviceDaoObj method getDistinctDisbursementNumbersForAchPaymentsNeedingAdviceNotification.
// KFSPTS-1460
/**
* Returns distinct disbursement numbers for ACH payments needing advice email notifications.
*
* NOTE:
* This method was made transactional per fix described in KULRICE-6914 for the iterator no longer
* containing the data and iter.hasNext() causing a run time exception.
*
* @return an iterator of Disbursement Numbers matching the given criteria
*/
@Transactional
public HashSet<Integer> getDistinctDisbursementNumbersForAchPaymentsNeedingAdviceNotification() {
LOG.debug("getDistinctDisbursementNumbersForAchPaymentsNeedingAdviceNotification() started");
Criteria criteria = new Criteria();
criteria.addEqualTo(PdpPropertyConstants.PaymentGroup.PAYMENT_GROUP_PAYMENT_STATUS_CODE, PdpConstants.PaymentStatusCodes.EXTRACTED);
criteria.addEqualTo(PdpPropertyConstants.PaymentGroup.PAYMENT_GROUP_DISBURSEMENT_TYPE_CODE, PdpConstants.DisbursementTypeCodes.ACH);
criteria.addIsNull(PdpPropertyConstants.ADVICE_EMAIL_SENT_DATE);
QueryByCriteria disbursementNumbersQuery = QueryFactory.newQuery(PaymentGroup.class, criteria);
Iterator iter = getPersistenceBrokerTemplate().getIteratorByQuery(disbursementNumbersQuery);
// used to pair down to distinct disbursement numbers
HashSet<Integer> results = new HashSet<Integer>();
while (iter.hasNext()) {
PaymentGroup pg = (PaymentGroup) iter.next();
results.add(new Integer(pg.getDisbursementNbr().toString()));
}
return results;
}
Aggregations