01: /*
02: * Copyright 2005-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 org.apache.ojb.broker.query.Criteria;
19: import org.apache.ojb.broker.query.QueryFactory;
20: import org.kuali.core.dao.ojb.PlatformAwareDaoBaseOjb;
21: import org.kuali.module.chart.bo.OffsetDefinition;
22: import org.kuali.module.chart.dao.OffsetDefinitionDao;
23:
24: /**
25: * This class is the OJB implementation of the OffsetDefinitionDao interface.
26: */
27: public class OffsetDefinitionDaoOjb extends PlatformAwareDaoBaseOjb
28: implements OffsetDefinitionDao {
29: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
30: .getLogger(OffsetDefinitionDaoOjb.class);
31:
32: /**
33: * @see org.kuali.module.chart.dao.OffsetDefinitionDao#getByPrimaryId(java.lang.Integer, java.lang.String, java.lang.String,
34: * java.lang.String)
35: */
36: public OffsetDefinition getByPrimaryId(
37: Integer universityFiscalYear, String chartOfAccountsCode,
38: String financialDocumentTypeCode,
39: String financialBalanceTypeCode) {
40: Criteria criteria = new Criteria();
41: criteria.addEqualTo("universityFiscalYear",
42: universityFiscalYear);
43: criteria.addEqualTo("chartOfAccountsCode", chartOfAccountsCode);
44: criteria.addEqualTo("financialDocumentTypeCode",
45: financialDocumentTypeCode);
46: criteria.addEqualTo("financialBalanceTypeCode",
47: financialBalanceTypeCode);
48:
49: return (OffsetDefinition) getPersistenceBrokerTemplate()
50: .getObjectByQuery(
51: QueryFactory.newQuery(OffsetDefinition.class,
52: criteria));
53: }
54: }
|