use of org.apache.ojb.broker.query.QueryByCriteria in project cu-kfs by CU-CommunityApps.
the class CheckReconciliationDaoOjb method getAllPaymentGroupForSearchCriteria.
/**
* @see com.rsmart.kuali.kfs.cr.dataaccess.CheckReconciliationDao#getAllPaymentGroupForSearchCriteria(java.lang.String, java.util.Collection)
*/
public List<PaymentGroup> getAllPaymentGroupForSearchCriteria(KualiInteger disbNbr, Collection<String> bankCodes) {
LOG.info("getAllPaymentGroupForSearchCriteria() starting");
Criteria criteria = new Criteria();
criteria.addEqualTo(PdpPropertyConstants.PaymentGroup.PAYMENT_GROUP_DISBURSEMENT_NBR, disbNbr);
criteria.addEqualTo(PdpPropertyConstants.PaymentGroup.PAYMENT_GROUP_DISBURSEMENT_TYPE_CODE, DisbursementTypeCodes.CHECK);
criteria.addIn(PdpPropertyConstants.PaymentGroup.PAYMENT_GROUP_BANK_CODE, bankCodes);
QueryByCriteria qbc = new QueryByCriteria(PaymentGroup.class, criteria);
LOG.info("getAllPaymentGroupForSearchCriteria() Query = " + qbc.toString());
List list = (List) getPersistenceBrokerTemplate().getCollectionByQuery(qbc);
return list;
}
use of org.apache.ojb.broker.query.QueryByCriteria in project cu-kfs by CU-CommunityApps.
the class CuDisbursementVoucherDaoOjb method getDocumentsByHeaderStatus.
/**
* @see org.kuali.kfs.fp.dataaccess.DisbursementVoucherDao#getDocumentsByHeaderStatus(java.lang.String, boolean)
*/
public Collection getDocumentsByHeaderStatus(String statusCode, boolean immediatesOnly) {
LOG.debug("getDocumentsByHeaderStatus() started");
Criteria criteria = new Criteria();
criteria.addEqualTo("documentHeader.financialDocumentStatusCode", statusCode);
criteria.addEqualTo("disbVchrPaymentMethodCode", KFSConstants.PaymentSourceConstants.PAYMENT_METHOD_CHECK);
if (immediatesOnly) {
criteria.addEqualTo("immediatePaymentIndicator", Boolean.TRUE);
}
return getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(getDisbursementVoucherDocumentClass(), criteria));
}
use of org.apache.ojb.broker.query.QueryByCriteria in project cu-kfs by CU-CommunityApps.
the class ProcurementCardDocumentDaoOjb method getDocumentByEdocNumber.
/**
* @see edu.cornell.kfs.fp.dataaccess.ProcurementCardDocumentDao#getDocumentByEdocNumber(java.lang.String)
*/
@Override
public List<ProcurementCardDocument> getDocumentByEdocNumber(String edocNumber) {
LOG.debug("getDocumentByCarhdHolderNameAmountDateCardHolderNetID() started");
if (StringUtils.isBlank(edocNumber)) {
LOG.error("Unable to validate input");
return null;
}
Criteria criteria = new Criteria();
criteria.addEqualTo("documentNumber", edocNumber);
return (List<ProcurementCardDocument>) getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(ProcurementCardDocument.class, criteria));
}
use of org.apache.ojb.broker.query.QueryByCriteria in project cu-kfs by CU-CommunityApps.
the class ProcurementCardDocumentDaoOjb method getDocumentByCarhdHolderAmountDateVendor.
public List<ProcurementCardDocument> getDocumentByCarhdHolderAmountDateVendor(String cardHolder, String amount, Date transactionDate) {
LOG.debug("getDocumentByAmountDateVendor() started");
if (StringUtils.isBlank(cardHolder) || StringUtils.isBlank(amount) || transactionDate == null) {
LOG.error("Unable to validate input. Card Holder Name: " + cardHolder + ", Amount: " + amount + ", Transaction Date: " + transactionDate);
return null;
}
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(transactionDate);
gc.add(Calendar.DATE, 21);
Criteria criteria = new Criteria();
criteria.addLike("procurementCardHolder.cardHolderName", convertCardHolderName(cardHolder));
criteria.addEqualTo("transactionEntries.transactionTotalAmount", amount);
criteria.addGreaterOrEqualThan("transactionEntries.transactionDate", transactionDate);
criteria.addLessOrEqualThan("transactionEntries.transactionDate", new Timestamp(gc.getTimeInMillis()));
return (List<ProcurementCardDocument>) getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(ProcurementCardDocument.class, criteria));
}
use of org.apache.ojb.broker.query.QueryByCriteria in project cu-kfs by CU-CommunityApps.
the class ProcurementCardDocumentDaoOjb method getDocumentByCarhdHolderNameAmountDateCardHolderNetID.
/**
* @see edu.cornell.kfs.fp.dataaccess.ProcurementCardDocumentDao#getDocumentByCarhdHolderNameAmountDateCardHolderNetID(java.lang.String, java.sql.Date, java.lang.String)
*/
@Override
public List<ProcurementCardDocument> getDocumentByCarhdHolderNameAmountDateCardHolderNetID(String amount, Date transactionDate, String cardHolderNetID) {
LOG.debug("getDocumentByCarhdHolderNameAmountDateCardHolderNetID() started");
if (StringUtils.isBlank(amount) || transactionDate == null || StringUtils.isBlank(cardHolderNetID)) {
LOG.error("Unable to validate input. Amount: " + amount + ", Transaction Date: " + transactionDate + ", Card Holder NetID: " + cardHolderNetID + ".");
return null;
}
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(transactionDate);
gc.add(Calendar.DATE, 21);
Criteria criteria = new Criteria();
criteria.addLike("procurementCardHolder.cardHolderAlternateName", cardHolderNetID.toUpperCase() + WILD_CARD);
criteria.addEqualTo("transactionEntries.transactionTotalAmount", amount);
criteria.addGreaterOrEqualThan("transactionEntries.transactionDate", transactionDate);
criteria.addLessOrEqualThan("transactionEntries.transactionDate", new Timestamp(gc.getTimeInMillis()));
return (List<ProcurementCardDocument>) getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(ProcurementCardDocument.class, criteria));
}
Aggregations