Search in sources :

Example 6 with Criteria

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

the class EzraAwardProposalDaoOjb method getProposals.

public List<EzraProposalAward> getProposals() {
    Criteria criteria = new Criteria();
    criteria.addLike("awardProposalId", "A%");
    criteria.addGreaterThan("budgetAmt", KualiDecimal.ZERO);
    criteria.addEqualTo("status", "ASAP");
    // 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());
    return (List<EzraProposalAward>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(EzraProposalAward.class, criteria));
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) Criteria(org.apache.ojb.broker.query.Criteria)

Example 7 with Criteria

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

the class SponsorDaoOjb method getSponsorsUpdatedSince.

public List<Sponsor> getSponsorsUpdatedSince(Date date) {
    Criteria criteria = new Criteria();
    if (date != null) {
        criteria.addGreaterThan("lastUpdated", date);
    }
    Criteria criteria2 = new Criteria();
    criteria.addNotNull("lastUpdated");
    criteria.addAndCriteria(criteria2);
    return (List<Sponsor>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(Sponsor.class, criteria));
}
Also used : List(java.util.List) Criteria(org.apache.ojb.broker.query.Criteria)

Example 8 with Criteria

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

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

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

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