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));
}
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));
}
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));
}
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;
}
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));
}
Aggregations