View Javadoc
1   /*
2    * Copyright 2005 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.OffsetDefinition;
22  import org.kuali.ole.coa.service.OffsetDefinitionService;
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 class is the service implementation for the OffsetDefinition structure. This is the default implementation, that is
30   * delivered with Kuali.
31   */
32  
33  @NonTransactional
34  public class OffsetDefinitionServiceImpl implements OffsetDefinitionService {
35  
36      /**
37       * @see org.kuali.ole.coa.service.OffsetDefinitionService#getByPrimaryId(java.lang.Integer, java.lang.String,
38       *      java.lang.String, java.lang.String)
39       */
40      public OffsetDefinition getByPrimaryId(Integer universityFiscalYear, String chartOfAccountsCode, String financialDocumentTypeCode, String financialBalanceTypeCode) {
41          Map<String, Object> keys = new HashMap<String, Object>();
42          keys.put(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR, universityFiscalYear);
43          keys.put(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE, chartOfAccountsCode);
44          keys.put(OLEPropertyConstants.FINANCIAL_DOCUMENT_TYPE_CODE, financialDocumentTypeCode);
45          keys.put(OLEPropertyConstants.FINANCIAL_BALANCE_TYPE_CODE, financialBalanceTypeCode);
46          return (OffsetDefinition)SpringContext.getBean(BusinessObjectService.class).findByPrimaryKey(OffsetDefinition.class, keys);
47      }
48  
49  }