View Javadoc
1   /*
2    * Copyright 2006 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
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.ole.coa.dataaccess.impl;
17  
18  import org.apache.ojb.broker.query.Criteria;
19  import org.apache.ojb.broker.query.QueryByCriteria;
20  import org.apache.ojb.broker.query.QueryFactory;
21  import org.kuali.ole.coa.businessobject.A21SubAccount;
22  import org.kuali.ole.coa.dataaccess.A21SubAccountDao;
23  import org.kuali.rice.core.framework.persistence.ojb.dao.PlatformAwareDaoBaseOjb;
24  
25  /**
26   * This class provides data access to {@link A21SubAccount} through OJB
27   */
28  public class A21SubAccountDaoOjb extends PlatformAwareDaoBaseOjb implements A21SubAccountDao {
29      private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(A21SubAccountDaoOjb.class);
30  
31      public A21SubAccountDaoOjb() {
32          super();
33      }
34  
35      /**
36       * @see org.kuali.ole.coa.dataaccess.A21SubAccountDao#getByPrimaryKey(java.lang.String, java.lang.String, java.lang.String)
37       */
38      public A21SubAccount getByPrimaryKey(String chartOfAccountsCode, String accountNumber, String subAccountNumber) {
39          LOG.debug("getByPrimaryKey() started");
40  
41          Criteria crit = new Criteria();
42          crit.addEqualTo("chartOfAccountsCode", chartOfAccountsCode);
43          crit.addEqualTo("accountNumber", accountNumber);
44          crit.addEqualTo("subAccountNumber", subAccountNumber);
45  
46          QueryByCriteria qbc = QueryFactory.newQuery(A21SubAccount.class, crit);
47          return (A21SubAccount) getPersistenceBrokerTemplate().getObjectByQuery(qbc);
48      }
49  }