Search in sources :

Example 1 with QueryByCriteria

use of org.apache.ojb.broker.query.QueryByCriteria in project cu-kfs by CU-CommunityApps.

the class CuCreditMemoDaoOjb method getCreditMemosToExtract.

@Override
public List<VendorCreditMemoDocument> getCreditMemosToExtract(String chartCode) {
    LOG.debug("getCreditMemosToExtract() started");
    Criteria criteria = new Criteria();
    criteria.addEqualTo("processingCampusCode", chartCode);
    criteria.addIsNull("extractedTimestamp");
    criteria.addEqualTo("holdIndicator", Boolean.FALSE);
    criteria.addEqualTo("paymentMethodCode", "P");
    return (List<VendorCreditMemoDocument>) getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(CuVendorCreditMemoDocument.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 2 with QueryByCriteria

use of org.apache.ojb.broker.query.QueryByCriteria in project cu-kfs by CU-CommunityApps.

the class CuPaymentRequestDaoOjb method getPaymentRequestsToExtractForVendor.

public Collection<PaymentRequestDocument> getPaymentRequestsToExtractForVendor(String campusCode, VendorGroupingHelper vendor, Date onOrBeforePaymentRequestPayDate) {
    LOG.debug("getPaymentRequestsToExtract() started");
    Criteria criteria = new Criteria();
    criteria.addEqualTo("processingCampusCode", campusCode);
    // criteria.addIn(PurapPropertyConstants.STATUS_CODE, statuses);
    criteria.addIsNull("extractedTimestamp");
    criteria.addEqualTo("holdIndicator", Boolean.FALSE);
    criteria.addEqualTo("paymentMethodCode", "P");
    Criteria c1 = new Criteria();
    c1.addLessOrEqualThan("paymentRequestPayDate", onOrBeforePaymentRequestPayDate);
    Criteria c2 = new Criteria();
    c2.addEqualTo("immediatePaymentIndicator", Boolean.TRUE);
    c1.addOrCriteria(c2);
    criteria.addAndCriteria(c1);
    criteria.addEqualTo("vendorHeaderGeneratedIdentifier", vendor.getVendorHeaderGeneratedIdentifier());
    criteria.addEqualTo("vendorDetailAssignedIdentifier", vendor.getVendorDetailAssignedIdentifier());
    criteria.addEqualTo("vendorCountryCode", vendor.getVendorCountry());
    criteria.addLike("vendorPostalCode", vendor.getVendorPostalCode() + "%");
    return (List<PaymentRequestDocument>) getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(CuPaymentRequestDocument.class, criteria));
}
Also used : QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) ReportQueryByCriteria(org.apache.ojb.broker.query.ReportQueryByCriteria) List(java.util.List) QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) ReportQueryByCriteria(org.apache.ojb.broker.query.ReportQueryByCriteria) Criteria(org.apache.ojb.broker.query.Criteria)

Example 3 with QueryByCriteria

use of org.apache.ojb.broker.query.QueryByCriteria in project cu-kfs by CU-CommunityApps.

the class CuPurchaseOrderDaoOjb method getAllOpenPurchaseOrders.

public List<AutoClosePurchaseOrderView> getAllOpenPurchaseOrders(List<String> excludedVendorChoiceCodes) {
    LOG.info("getAllOpenPurchaseOrders() started");
    Criteria criteria = new Criteria();
    criteria.addIsNull(PurapPropertyConstants.RECURRING_PAYMENT_TYPE_CODE);
    criteria.addEqualTo(PurapPropertyConstants.TOTAL_ENCUMBRANCE, new KualiDecimal(0));
    criteria.addEqualTo(PurapPropertyConstants.PURCHASE_ORDER_CURRENT_INDICATOR, true);
    criteria.addEqualTo(KewApiConstants.APP_DOC_STATUS_DETAIL, PurapConstants.PurchaseOrderStatuses.APPDOC_OPEN);
    for (String excludeCode : excludedVendorChoiceCodes) {
        criteria.addNotEqualTo(PurapPropertyConstants.VENDOR_CHOICE_CODE, excludeCode);
    }
    QueryByCriteria qbc = new QueryByCriteria(CuAutoClosePurchaseOrderView.class, criteria);
    LOG.info("getAllOpenPurchaseOrders() Query criteria is " + criteria.toString());
    // KFSUPGRADE-363
    limitResultSize(qbc);
    List<AutoClosePurchaseOrderView> l = (List<AutoClosePurchaseOrderView>) getPersistenceBrokerTemplate().getCollectionByQuery(qbc);
    LOG.info("getAllOpenPurchaseOrders() ended.");
    return l;
}
Also used : CuAutoClosePurchaseOrderView(edu.cornell.kfs.module.purap.businessobject.CuAutoClosePurchaseOrderView) AutoClosePurchaseOrderView(org.kuali.kfs.module.purap.businessobject.AutoClosePurchaseOrderView) QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) List(java.util.List) QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) Criteria(org.apache.ojb.broker.query.Criteria)

Example 4 with QueryByCriteria

use of org.apache.ojb.broker.query.QueryByCriteria in project cu-kfs by CU-CommunityApps.

the class CheckReconciliationDaoOjb method getAllCheckReconciliationForSearchCriteria.

/**
 * Get All Check Reconciliation For Search Criteria
 *
 * @see com.rsmart.kuali.kfs.cr.dataaccess.CheckReconciliationDao#getAllCheckReconciliationForSearchCriteria(java.util.Date, java.util.Date)
 */
public List getAllCheckReconciliationForSearchCriteria(Date startDate, Date endDate) {
    LOG.info("getAllCheckReconciliationForSearchCriteria() starting");
    Criteria criteria = new Criteria();
    criteria.addEqualTo("status", CRConstants.ISSUED);
    if (!(startDate == null)) {
        criteria.addGreaterOrEqualThan("checkDate", startDate);
    }
    if (!(endDate == null)) {
        GregorianCalendar gc = new GregorianCalendar();
        gc.setTime(endDate);
        // gc.add(Calendar.DATE, 1);
        criteria.addLessOrEqualThan("checkDate", new Timestamp(gc.getTimeInMillis()));
    }
    QueryByCriteria qbc = new QueryByCriteria(CheckReconciliation.class, criteria);
    qbc.addOrderBy("bankAccountNumber", true);
    qbc.addOrderBy("checkDate", true);
    LOG.info("getAllCheckReconciliationForSearchCriteria() Query = " + qbc.toString());
    List list = (List) getPersistenceBrokerTemplate().getCollectionByQuery(qbc);
    return list;
}
Also used : QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) GregorianCalendar(java.util.GregorianCalendar) ArrayList(java.util.ArrayList) List(java.util.List) QueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria) Criteria(org.apache.ojb.broker.query.Criteria) Timestamp(java.sql.Timestamp)

Example 5 with QueryByCriteria

use of org.apache.ojb.broker.query.QueryByCriteria in project cu-kfs by CU-CommunityApps.

the class CheckReconciliationDaoOjb method getAll.

/**
 * Get All
 *
 * @see com.rsmart.kuali.kfs.cr.dataaccess.CheckReconciliationDao#getAll()
 */
public List getAll() {
    LOG.info("getAll() started");
    QueryByCriteria qbc = new QueryByCriteria(CheckReconciliationDaoOjb.class);
    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)

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