Search in sources :

Example 1 with Criteria

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

the class CULaborObjectDaoOjb method getByPrimaryId.

public LaborObject getByPrimaryId(int fiscalYear, String chartCode, String objectCode) {
    Criteria criteria = new Criteria();
    criteria.addEqualTo("universityFiscalYear", fiscalYear);
    criteria.addEqualTo("chartOfAccountsCode", chartCode == null ? chartCode : chartCode.toUpperCase());
    criteria.addEqualTo("financialObjectCode", objectCode == null ? objectCode : objectCode.toUpperCase());
    return (LaborObject) getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(LaborObject.class, criteria));
}
Also used : LaborObject(org.kuali.kfs.module.ld.businessobject.LaborObject) Criteria(org.apache.ojb.broker.query.Criteria)

Example 2 with Criteria

use of org.apache.ojb.broker.query.Criteria 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 3 with Criteria

use of org.apache.ojb.broker.query.Criteria 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 4 with Criteria

use of org.apache.ojb.broker.query.Criteria 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 5 with Criteria

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

the class EzraAwardProposalDaoOjb method getAwardsUpdatedSince.

public List<EzraProposalAward> getAwardsUpdatedSince(Date date) {
    BusinessObjectService bos = SpringContext.getBean(BusinessObjectService.class);
    Collection<Award> awards = bos.findAll(Award.class);
    List awardNumbers = new ArrayList();
    for (Award award : awards) {
        awardNumbers.add(award.getProposalNumber());
    }
    Criteria criteria = new Criteria();
    criteria.addIn("projectId", awardNumbers);
    criteria.addLike("awardProposalId", "A%");
    // KFSPTS-1920 Edits associated with Award Descriptions of MTA(M), NDA(N), RDA(R) should not be picked up for edits to KFS Awards.
    criteria.addNotIn("awardDescriptionCode", getExcludedAwardDescriptions());
    if (date != null) {
        criteria.addGreaterThan("lastUpdated", date);
    }
    return (List<EzraProposalAward>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(EzraProposalAward.class, criteria));
}
Also used : Award(org.kuali.kfs.module.cg.businessobject.Award) EzraProposalAward(edu.cornell.kfs.module.ezra.businessobject.EzraProposalAward) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Criteria(org.apache.ojb.broker.query.Criteria) BusinessObjectService(org.kuali.kfs.krad.service.BusinessObjectService)

Aggregations

Criteria (org.apache.ojb.broker.query.Criteria)32 QueryByCriteria (org.apache.ojb.broker.query.QueryByCriteria)27 List (java.util.List)19 ArrayList (java.util.ArrayList)6 ReportQueryByCriteria (org.apache.ojb.broker.query.ReportQueryByCriteria)4 Timestamp (java.sql.Timestamp)3 GregorianCalendar (java.util.GregorianCalendar)3 Iterator (java.util.Iterator)3 PaymentGroup (org.kuali.kfs.pdp.businessobject.PaymentGroup)2 Transactional (org.springframework.transaction.annotation.Transactional)2 AccountReversion (edu.cornell.kfs.coa.businessobject.AccountReversion)1 EzraProposalAward (edu.cornell.kfs.module.ezra.businessobject.EzraProposalAward)1 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 Account (org.kuali.kfs.coa.businessobject.Account)1