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.PriorYearAccount;
22: import org.kuali.module.chart.dao.PriorYearAccountDao;
23:
24: /**
25: * This class implements the {@link PriorYearAccountDao} data access methods using Ojb
26: */
27: public class PriorYearAccountDaoOjb extends PlatformAwareDaoBaseOjb
28: implements PriorYearAccountDao {
29:
30: /**
31: * @see org.kuali.module.chart.dao.PriorYearAccountDao#getByPrimaryId(java.lang.String, java.lang.String)
32: */
33: public PriorYearAccount getByPrimaryId(String chartOfAccountsCode,
34: String accountNumber) {
35:
36: Criteria criteria = new Criteria();
37: criteria.addEqualTo("chartOfAccountsCode", chartOfAccountsCode);
38: criteria.addEqualTo("accountNumber", accountNumber);
39:
40: return (PriorYearAccount) getPersistenceBrokerTemplate()
41: .getObjectByQuery(
42: QueryFactory.newQuery(PriorYearAccount.class,
43: criteria));
44: }
45:
46: }
|