1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.pdp.dataaccess.impl;
17
18 import java.util.ArrayList;
19 import java.util.Collection;
20 import java.util.Iterator;
21
22 import org.apache.ojb.broker.query.Criteria;
23 import org.apache.ojb.broker.query.QueryByCriteria;
24 import org.kuali.ole.pdp.PdpConstants;
25 import org.kuali.ole.pdp.PdpPropertyConstants;
26 import org.kuali.ole.pdp.businessobject.PaymentGroupHistory;
27 import org.kuali.ole.pdp.dataaccess.PaymentGroupHistoryDao;
28 import org.kuali.rice.core.framework.persistence.ojb.dao.PlatformAwareDaoBaseOjb;
29
30 public class PaymentGroupHistoryDaoOjb extends PlatformAwareDaoBaseOjb implements PaymentGroupHistoryDao {
31 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(PaymentGroupHistoryDaoOjb.class);
32
33 public PaymentGroupHistoryDaoOjb() {
34 super();
35 }
36
37
38
39
40 public Iterator getCanceledChecks() {
41 LOG.debug("getCanceledChecks() started");
42
43 Collection codes = new ArrayList();
44 codes.add(PdpConstants.PaymentChangeCodes.CANCEL_DISBURSEMENT);
45 codes.add(PdpConstants.PaymentChangeCodes.CANCEL_REISSUE_DISBURSEMENT);
46 codes.add(PdpConstants.PaymentChangeCodes.REISSUE_DISBURSEMENT);
47
48 Criteria crit = new Criteria();
49 crit.addIn(PdpPropertyConstants.PAYMENT_CHANGE_CODE, codes);
50 crit.addIsNull(PdpPropertyConstants.PaymentGroupHistory.PMT_CANCEL_EXTRACT_DATE);
51
52 Criteria o1 = new Criteria();
53 o1.addNotEqualTo(PdpPropertyConstants.DISBURSEMENT_TYPE_CODE, PdpConstants.DisbursementTypeCodes.ACH);
54 Criteria o1a = new Criteria();
55 o1a.addIsNull(PdpPropertyConstants.DISBURSEMENT_TYPE_CODE);
56 o1.addOrCriteria(o1a);
57
58 Criteria o2 = new Criteria();
59 o2.addEqualTo(PdpPropertyConstants.DISBURSEMENT_TYPE_CODE, PdpConstants.DisbursementTypeCodes.CHECK);
60 Criteria o2a = new Criteria();
61 o2a.addEqualTo(PdpPropertyConstants.PAYMENT_GROUP + "." + PdpPropertyConstants.DISBURSEMENT_TYPE_CODE, PdpConstants.DisbursementTypeCodes.CHECK);
62 o2.addOrCriteria(o2a);
63
64 crit.addAndCriteria(o1);
65 crit.addAndCriteria(o2);
66
67 return getPersistenceBrokerTemplate().getIteratorByQuery(new QueryByCriteria(PaymentGroupHistory.class, crit));
68 }
69 }