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.SubObjCd;
22: import org.kuali.module.chart.dao.SubObjectCodeDao;
23:
24: /**
25: * This class is the OJB implementation of the SubObjectCodeDao interface.
26: */
27: public class SubObjectCodeDaoOjb extends PlatformAwareDaoBaseOjb
28: implements SubObjectCodeDao {
29: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
30: .getLogger(SubObjectCodeDaoOjb.class);
31:
32: /**
33: * Retrieves sub object code business object by primary key
34: *
35: * @param universityFiscalYear - part of composite key
36: * @param chartOfAccountsCode - part of composite key
37: * @param accountNumber - part of composite key
38: * @param financialObjectCode - part of composite key
39: * @param financialSubObjectCode - part of composite key
40: * @return SubObjectCode
41: * @see SubObjectCodeDao#getByPrimaryId(Integer, String, String, String, String)
42: */
43: public SubObjCd getByPrimaryId(Integer universityFiscalYear,
44: String chartOfAccountsCode, String accountNumber,
45: String financialObjectCode, String financialSubObjectCode) {
46:
47: Criteria criteria = new Criteria();
48: criteria.addEqualTo("universityFiscalYear",
49: universityFiscalYear);
50: criteria.addEqualTo("chartOfAccountsCode", chartOfAccountsCode);
51: criteria.addEqualTo("accountNumber", accountNumber);
52: criteria.addEqualTo("financialObjectCode", financialObjectCode);
53: criteria.addEqualTo("financialSubObjectCode",
54: financialSubObjectCode);
55:
56: return (SubObjCd) getPersistenceBrokerTemplate()
57: .getObjectByQuery(
58: QueryFactory.newQuery(SubObjCd.class, criteria));
59: }
60: }
|