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