1
2
3
4
5
6
7
8
9
10
11
12
13
14
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.SubAccount;
22 import org.kuali.ole.coa.service.SubAccountService;
23 import org.kuali.ole.sys.OLEPropertyConstants;
24 import org.kuali.ole.sys.service.NonTransactional;
25 import org.kuali.rice.krad.service.BusinessObjectService;
26 import org.springframework.cache.annotation.Cacheable;
27
28
29
30
31
32
33 @NonTransactional
34 public class SubAccountServiceImpl implements SubAccountService {
35
36 protected BusinessObjectService businessObjectService;
37
38
39
40 @Override
41 public SubAccount getByPrimaryId(String chartOfAccountsCode, String accountNumber, String subAccountNumber) {
42 Map<String, Object> keys = new HashMap<String, Object>(3);
43 keys.put(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE, chartOfAccountsCode);
44 keys.put(OLEPropertyConstants.ACCOUNT_NUMBER, accountNumber);
45 keys.put(OLEPropertyConstants.SUB_ACCOUNT_NUMBER, subAccountNumber);
46 return businessObjectService.findByPrimaryKey(SubAccount.class, keys);
47 }
48
49
50
51
52
53
54 @Override
55 @Cacheable(value=SubAccount.CACHE_NAME, key="#p0+'-'+#p1+'-'+#p2")
56 public SubAccount getByPrimaryIdWithCaching(String chartOfAccountsCode, String accountNumber, String subAccountNumber) {
57 return getByPrimaryId(chartOfAccountsCode, accountNumber, subAccountNumber);
58 }
59
60 public void setBusinessObjectService(BusinessObjectService businessObjectService) {
61 this.businessObjectService = businessObjectService;
62 }
63
64 }