use of org.apache.ojb.broker.query.Criteria in project cu-kfs by CU-CommunityApps.
the class AccountReversionDaoOjb method getAccountReversionsByCashReversionAcount.
/**
* @see edu.cornell.kfs.coa.dataaccess.AccountReversionDao#getAccountReversionsByCashReversionAcount(java.lang.String, java.lang.String)
*/
@Override
public List<AccountReversion> getAccountReversionsByCashReversionAcount(String cashReversionFinancialChartOfAccountsCode, String cashReversionAccountNumber) {
LOG.debug("getAccountReversionsByCashReversionAcount() started");
Criteria criteria = new Criteria();
criteria.addEqualTo(CUKFSPropertyConstants.ACCT_REVERSION_CASH_REVERSION_CHART_OF_ACCT_CODE, cashReversionFinancialChartOfAccountsCode);
criteria.addEqualTo(CUKFSPropertyConstants.ACCT_REVERSION_CASH_REVERSION_ACCT_NUMBER, cashReversionAccountNumber);
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 getCategories.
/**
* @see org.kuali.kfs.coa.dataaccess.OrganizationReversionDao#getCategories()
*/
public List<ReversionCategory> getCategories() {
LOG.debug("getCategories() started");
Criteria criteria = new Criteria();
criteria.addEqualTo("active", true);
QueryByCriteria q = QueryFactory.newQuery(ReversionCategory.class, criteria);
q.addOrderByAscending("reversionSortCode");
return (List) getPersistenceBrokerTemplate().getCollectionByQuery(q);
}
use of org.apache.ojb.broker.query.Criteria in project cu-kfs by CU-CommunityApps.
the class AccountReversionDaoOjb method getAccountReversionsByChartAndAccount.
/**
* @see edu.cornell.kfs.coa.dataaccess.AccountReversionDao#getAccountReversionsByChartAndAccount(java.lang.String, java.lang.String)
*/
@Override
public List<AccountReversion> getAccountReversionsByChartAndAccount(String chartOfAccountsCode, String accountNumber) {
LOG.debug("getAccountReversionsByChartAndAccount() started");
Criteria criteria = new Criteria();
criteria.addEqualTo(CUKFSPropertyConstants.ACCT_REVERSION_CHART_OF_ACCT_CODE, chartOfAccountsCode);
criteria.addEqualTo(CUKFSPropertyConstants.ACCT_REVERSION_ACCT_NUMBER, accountNumber);
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 CuDisbursementVoucherDaoOjb method getDocument.
/**
* @see org.kuali.kfs.fp.dataaccess.DisbursementVoucherDao#getDocument(java.lang.String)
*/
public DisbursementVoucherDocument getDocument(String fdocNbr) {
LOG.debug("getDocument() started");
Criteria criteria = new Criteria();
criteria.addEqualTo("documentNumber", fdocNbr);
return (DisbursementVoucherDocument) getPersistenceBrokerTemplate().getObjectByQuery(new QueryByCriteria(getDisbursementVoucherDocumentClass(), criteria));
}
use of org.apache.ojb.broker.query.Criteria in project cu-kfs by CU-CommunityApps.
the class CuBalanceDaoOjb method findReversionBalancesForFiscalYear.
/**
* Returns a list of balances to return for the Organization Reversion year end job to process
*
* @param year the university fiscal year to find balances for
* @param endOfYear if true, use currrent year accounts, otherwise use prior year accounts
* @return an Iterator of Balances to process
* @see org.kuali.kfs.gl.dataaccess.BalanceDao#findOrganizationReversionBalancesForFiscalYear(java.lang.Integer, boolean,
* org.kuali.kfs.sys.businessobject.SystemOptions, java.util.List)
*/
@SuppressWarnings({ "deprecation", "unchecked" })
public Iterator<Balance> findReversionBalancesForFiscalYear(Integer year, boolean endOfYear, SystemOptions options, List<ParameterEvaluator> parameterEvaluators) {
LOG.debug("findReversionBalancesForFiscalYear() started");
Criteria c = new Criteria();
c.addEqualTo(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, year);
for (ParameterEvaluator parameterEvaluator : parameterEvaluators) {
String currentRule = parameterEvaluator.getValue();
if (endOfYear) {
currentRule = currentRule.replaceAll("account\\.", "priorYearAccount.");
}
if (StringUtils.isNotBlank(currentRule)) {
String propertyName = StringUtils.substringBefore(currentRule, "=");
List<String> ruleValues = Arrays.asList(StringUtils.substringAfter(currentRule, "=").split(";"));
if (propertyName != null && propertyName.length() > 0 && ruleValues.size() > 0 && !StringUtils.isBlank(ruleValues.get(0))) {
if (parameterEvaluator.constraintIsAllow()) {
c.addIn(propertyName, ruleValues);
} else {
c.addNotIn(propertyName, ruleValues);
}
}
}
}
// we only ever calculate on CB, AC, and encumbrance types, so let's only select those
List<String> reversionBalancesToSelect = new ArrayList<String>();
reversionBalancesToSelect.add(options.getActualFinancialBalanceTypeCd());
reversionBalancesToSelect.add(options.getFinObjTypeExpenditureexpCd());
reversionBalancesToSelect.add(options.getCostShareEncumbranceBalanceTypeCd());
reversionBalancesToSelect.add(options.getIntrnlEncumFinBalanceTypCd());
reversionBalancesToSelect.add(KFSConstants.BALANCE_TYPE_CURRENT_BUDGET);
c.addIn(KFSPropertyConstants.BALANCE_TYPE_CODE, reversionBalancesToSelect);
QueryByCriteria query = QueryFactory.newQuery(Balance.class, c);
query.addOrderByAscending(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE);
query.addOrderByAscending(KFSPropertyConstants.ACCOUNT_NUMBER);
query.addOrderByAscending(KFSPropertyConstants.SUB_ACCOUNT_NUMBER);
query.addOrderByAscending(KFSPropertyConstants.OBJECT_CODE);
query.addOrderByAscending(KFSPropertyConstants.SUB_OBJECT_CODE);
query.addOrderByAscending(KFSPropertyConstants.BALANCE_TYPE_CODE);
query.addOrderByAscending(KFSPropertyConstants.OBJECT_TYPE_CODE);
return getPersistenceBrokerTemplate().getIteratorByQuery(query);
}
Aggregations