Search in sources :

Example 6 with QueryByCriteria

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;
}
Also used : QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) ArrayList(java.util.ArrayList) List(java.util.List) QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) Criteria(org.apache.ojb.broker.query.Criteria)

Example 7 with QueryByCriteria

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));
}
Also used : QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) Criteria(org.apache.ojb.broker.query.Criteria)

Example 8 with QueryByCriteria

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));
}
Also used : QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) List(java.util.List) QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) Criteria(org.apache.ojb.broker.query.Criteria)

Example 9 with QueryByCriteria

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));
}
Also used : QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) GregorianCalendar(java.util.GregorianCalendar) List(java.util.List) QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) Criteria(org.apache.ojb.broker.query.Criteria) Timestamp(java.sql.Timestamp)

Example 10 with QueryByCriteria

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));
}
Also used : QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) GregorianCalendar(java.util.GregorianCalendar) List(java.util.List) QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) Criteria(org.apache.ojb.broker.query.Criteria) Timestamp(java.sql.Timestamp)

Aggregations

QueryByCriteria (org.apache.ojb.broker.query.QueryByCriteria)27 Criteria (org.apache.ojb.broker.query.Criteria)25 List (java.util.List)17 ArrayList (java.util.ArrayList)5 Timestamp (java.sql.Timestamp)3 GregorianCalendar (java.util.GregorianCalendar)3 Iterator (java.util.Iterator)3 ReportQueryByCriteria (org.apache.ojb.broker.query.ReportQueryByCriteria)3 PaymentGroup (org.kuali.kfs.pdp.businessobject.PaymentGroup)2 Transactional (org.springframework.transaction.annotation.Transactional)2 CuAutoClosePurchaseOrderView (edu.cornell.kfs.module.purap.businessobject.CuAutoClosePurchaseOrderView)1 Date (java.sql.Date)1 ParseException (java.text.ParseException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 RemovalAwareCollection (org.apache.ojb.broker.util.collections.RemovalAwareCollection)1 DisbursementVoucherDocument (org.kuali.kfs.fp.document.DisbursementVoucherDocument)1 Attachment (org.kuali.kfs.krad.bo.Attachment)1 DataObjectRelationship (org.kuali.kfs.krad.bo.DataObjectRelationship)1