View Javadoc
1   /*
2    * Copyright 2006-2008 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  package org.kuali.ole.coa.dataaccess.impl;
17  
18  import java.util.Collection;
19  
20  import org.apache.ojb.broker.query.Criteria;
21  import org.apache.ojb.broker.query.QueryByCriteria;
22  import org.apache.ojb.broker.query.QueryFactory;
23  import org.kuali.ole.coa.businessobject.IndirectCostRecoveryRateDetail;
24  import org.kuali.ole.coa.dataaccess.IndirectCostRecoveryRateDetailDao;
25  import org.kuali.ole.sys.OLEPropertyConstants;
26  import org.kuali.rice.core.framework.persistence.ojb.dao.PlatformAwareDaoBaseOjb;
27  
28  /**
29   * This class implements the {@link IndirectCostRecoverRateDetailDao} data access methods using Ojb
30   */
31  public class IndirectCostRecoveryRateDetailDaoOjb extends PlatformAwareDaoBaseOjb implements IndirectCostRecoveryRateDetailDao {
32      private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(IndirectCostRecoveryRateDetailDaoOjb.class);
33  
34      /**
35       * @see org.kuali.ole.coa.dataaccess.IndirectCostRecoveryRateDetailDao#getEntriesBySeries(java.lang.Integer, java.lang.String,
36       *      java.lang.String)
37       */
38      public Collection<IndirectCostRecoveryRateDetail> getActiveRateDetailsByRate(Integer universityFiscalYear, String financialIcrSeriesIdentifier) {
39          LOG.debug("getEntriesBySeries() started");
40  
41          Criteria crit = new Criteria();
42          crit.addEqualTo(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR, universityFiscalYear);
43          crit.addEqualTo(OLEPropertyConstants.FINANCIAL_ICR_SERIES_IDENTIFIER, financialIcrSeriesIdentifier);
44          crit.addEqualTo(OLEPropertyConstants.ACTIVE, Boolean.TRUE);
45          
46          QueryByCriteria qbc = QueryFactory.newQuery(IndirectCostRecoveryRateDetail.class, crit);
47          qbc.addOrderByAscending(OLEPropertyConstants.AWARD_INDR_COST_RCVY_ENTRY_NBR);
48  
49          return getPersistenceBrokerTemplate().getCollectionByQuery(qbc);
50      }
51  }