01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.chart.dao.ojb;
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.core.dao.ojb.PlatformAwareDaoBaseOjb;
24: import org.kuali.kfs.KFSPropertyConstants;
25: import org.kuali.module.chart.bo.IcrAutomatedEntry;
26: import org.kuali.module.chart.dao.IcrAutomatedEntryDao;
27:
28: /**
29: * This class implements the {@link IcrAutomatedEntryDao} data access methods using Ojb
30: */
31: public class IcrAutomatedEntryDaoOjb extends PlatformAwareDaoBaseOjb
32: implements IcrAutomatedEntryDao {
33: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
34: .getLogger(IcrAutomatedEntryDaoOjb.class);
35:
36: /**
37: * @see org.kuali.module.chart.dao.IcrAutomatedEntryDao#getEntriesBySeries(java.lang.Integer, java.lang.String,
38: * java.lang.String)
39: */
40: public Collection getEntriesBySeries(Integer universityFiscalYear,
41: String financialIcrSeriesIdentifier, String balanceTypeCode) {
42: LOG.debug("getEntriesBySeries() started");
43:
44: Criteria crit = new Criteria();
45: crit.addEqualTo(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR,
46: universityFiscalYear);
47: crit.addEqualTo(
48: KFSPropertyConstants.FINANCIAL_ICR_SERIES_IDENTIFIER,
49: financialIcrSeriesIdentifier);
50: crit.addEqualTo(KFSPropertyConstants.BALANCE_TYPE_CODE,
51: balanceTypeCode);
52:
53: QueryByCriteria qbc = QueryFactory.newQuery(
54: IcrAutomatedEntry.class, crit);
55: qbc
56: .addOrderByAscending(KFSPropertyConstants.AWARD_INDR_COST_RCVY_ENTRY_NBR);
57:
58: return getPersistenceBrokerTemplate().getCollectionByQuery(qbc);
59: }
60: }
|