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.ObjLevel;
22: import org.kuali.module.chart.dao.ObjectLevelDao;
23:
24: /**
25: * This class is the OJB implementation of the ObjectLevelDao interface.
26: */
27: public class ObjectLevelDaoOjb extends PlatformAwareDaoBaseOjb
28: implements ObjectLevelDao {
29: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
30: .getLogger(ObjectLevelDaoOjb.class);
31:
32: /**
33: * @see org.kuali.module.chart.dao.ObjectLevelDao#getByPrimaryId(java.lang.String, java.lang.String)
34: */
35: public ObjLevel getByPrimaryId(String chartOfAccountsCode,
36: String objectLevelCode) {
37: Criteria criteria = new Criteria();
38: criteria.addEqualTo("chartOfAccountsCode", chartOfAccountsCode);
39: criteria
40: .addEqualTo("financialObjectLevelCode", objectLevelCode);
41:
42: return (ObjLevel) getPersistenceBrokerTemplate()
43: .getObjectByQuery(
44: QueryFactory.newQuery(ObjLevel.class, criteria));
45: }
46:
47: }
|