1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.kuali.ole.pdp.dataaccess.impl;
21
22 import java.util.List;
23
24 import org.apache.ojb.broker.query.Criteria;
25 import org.apache.ojb.broker.query.QueryByCriteria;
26 import org.kuali.ole.pdp.PdpPropertyConstants;
27 import org.kuali.ole.pdp.businessobject.PaymentProcess;
28 import org.kuali.ole.pdp.dataaccess.ProcessDao;
29 import org.kuali.rice.core.framework.persistence.ojb.dao.PlatformAwareDaoBaseOjb;
30
31
32
33
34
35 public class ProcessDaoOjb extends PlatformAwareDaoBaseOjb implements ProcessDao {
36 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ProcessDaoOjb.class);
37
38 public ProcessDaoOjb() {
39 super();
40 }
41
42 public List<PaymentProcess> getAllExtractsToRun() {
43 Criteria c = new Criteria();
44 c.addEqualTo(PdpPropertyConstants.PaymentProcess.EXTRACTED_IND, false);
45 c.addEqualTo(PdpPropertyConstants.PaymentProcess.FORMATTED_IND, true);
46 return (List<PaymentProcess>) getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(PaymentProcess.class, c));
47 }
48
49 public PaymentProcess get(Integer procId) {
50 LOG.debug("get() started");
51
52 Criteria c = new Criteria();
53 c.addEqualTo("id", procId);
54
55 PaymentProcess p = (PaymentProcess) getPersistenceBrokerTemplate().getObjectByQuery(new QueryByCriteria(PaymentProcess.class, c));
56 if (p != null) {
57
58 return p;
59 }
60 else {
61 return null;
62 }
63 }
64
65 }
66