View Javadoc
1   /*
2    * Copyright 2007 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  /*
17   * Created on Aug 19, 2004
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