View Javadoc
1   /*
2    * Copyright 2005-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.service.impl;
17  
18  import java.util.HashMap;
19  import java.util.Map;
20  
21  import org.kuali.ole.coa.businessobject.ObjectLevel;
22  import org.kuali.ole.coa.service.ObjectLevelService;
23  import org.kuali.ole.sys.OLEPropertyConstants;
24  import org.kuali.ole.sys.context.SpringContext;
25  import org.kuali.ole.sys.service.NonTransactional;
26  import org.kuali.rice.krad.service.BusinessObjectService;
27  
28  /**
29   * This service implementation is the default implementation of the ObjLevel service that is delivered with Kuali.
30   */
31  
32  @NonTransactional
33  public class ObjectLevelServiceImpl implements ObjectLevelService {
34  
35      /**
36       * @see org.kuali.ole.coa.service.ObjectLevelService#getByPrimaryId(java.lang.String, java.lang.String)
37       */
38      public ObjectLevel getByPrimaryId(String chartOfAccountsCode, String objectLevelCode) {
39          Map<String, Object> keys = new HashMap<String, Object>();
40          keys.put(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE, chartOfAccountsCode);
41          keys.put(OLEPropertyConstants.FINANCIAL_OBJECT_LEVEL_CODE, objectLevelCode);
42          return (ObjectLevel)SpringContext.getBean(BusinessObjectService.class).findByPrimaryKey(ObjectLevel.class, keys);
43      }
44  
45  }