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.service.impl;
17:
18: import java.util.List;
19:
20: import org.apache.log4j.Logger;
21: import org.kuali.core.util.spring.Cached;
22: import org.kuali.module.chart.bo.SubAccount;
23: import org.kuali.module.chart.dao.SubAccountDao;
24: import org.kuali.module.chart.service.SubAccountService;
25: import org.springframework.transaction.annotation.Transactional;
26:
27: /**
28: * This class is the service implementation for the SubAccount structure. This is the default implementation that gets delivered
29: * with Kuali.
30: */
31: @Transactional
32: public class SubAccountServiceImpl implements SubAccountService {
33: private static final Logger LOG = Logger
34: .getLogger(SubAccountServiceImpl.class);
35:
36: private SubAccountDao subAccountDao;
37:
38: /**
39: * @see org.kuali.module.chart.service.SubAccountService#getByPrimaryId(java.lang.String, java.lang.String, java.lang.String)
40: */
41: public SubAccount getByPrimaryId(String chartOfAccountsCode,
42: String accountNumber, String subAccountNumber) {
43: return subAccountDao.getByPrimaryId(chartOfAccountsCode,
44: accountNumber, subAccountNumber);
45: }
46:
47: /**
48: * Method is used by KualiAccountAttribute to enable caching of accounts for routing.
49: *
50: * @see org.kuali.module.chart.service.impl.SubAccountServiceImpl#getByPrimaryId(String, String, String)
51: */
52: @Cached
53: public SubAccount getByPrimaryIdWithCaching(
54: String chartOfAccountsCode, String accountNumber,
55: String subAccountNumber) {
56: return subAccountDao.getByPrimaryId(chartOfAccountsCode,
57: accountNumber, subAccountNumber);
58: }
59:
60: /**
61: * Retrieves SubAccount objects associated with the given chart-org-subAccount code combination
62: *
63: * @param chartOfAccountsCode - 'Reports To' Chart of Accounts Code
64: * @param organizationCode - 'Reports To' Organization Code
65: * @param subAccountNumber - Sub Account Number
66: * @return a list of SubAccount objects
67: */
68: public List getSubAccountsByReportsToOrganization(
69: String chartOfAccountsCode, String organizationCode,
70: String subAccountNumber) {
71: return subAccountDao
72: .getSubAccountsByReportsToOrganization(
73: chartOfAccountsCode, organizationCode,
74: subAccountNumber);
75: }
76:
77: /**
78: * @return SubAccountDao
79: */
80: public SubAccountDao getSubAccountDao() {
81: return subAccountDao;
82: }
83:
84: /**
85: * @param subAccountDao
86: */
87: public void setSubAccountDao(SubAccountDao subAccountDao) {
88: this.subAccountDao = subAccountDao;
89: }
90: }
|