01: /*
02: * Copyright 2006-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 org.apache.log4j.Logger;
19: import org.kuali.module.chart.bo.PriorYearAccount;
20: import org.kuali.module.chart.dao.PriorYearAccountDao;
21: import org.kuali.module.chart.dao.jdbc.PriorYearAccountDaoJdbc;
22: import org.kuali.module.chart.service.PriorYearAccountService;
23: import org.springframework.transaction.annotation.Transactional;
24:
25: /**
26: * This class implements the PriorYearAccountService interface.
27: */
28: @Transactional
29: public class PriorYearAccountServiceImpl implements
30: PriorYearAccountService {
31: private static final Logger LOG = Logger
32: .getLogger(PriorYearAccountServiceImpl.class);
33:
34: private PriorYearAccountDao priorYearAccountDao;
35: private PriorYearAccountDaoJdbc priorYearAccountDaoJdbc;
36:
37: public PriorYearAccountServiceImpl() {
38: super ();
39: }
40:
41: /**
42: *
43: * @see org.kuali.module.chart.service.PriorYearAccountService#getByPrimaryKey(java.lang.String, java.lang.String)
44: */
45: public PriorYearAccount getByPrimaryKey(String chartCode,
46: String accountNumber) {
47: return priorYearAccountDao.getByPrimaryId(chartCode,
48: accountNumber);
49: }
50:
51: /**
52: * @see org.kuali.module.chart.service.PriorYearAccountService#populatePriorYearAccountsFromCurrent()
53: */
54: public void populatePriorYearAccountsFromCurrent() {
55:
56: int purgedCount = priorYearAccountDaoJdbc
57: .purgePriorYearAccounts();
58: if (LOG.isInfoEnabled()) {
59: LOG.info("number of prior year accounts purged : "
60: + purgedCount);
61: }
62:
63: int copiedCount = priorYearAccountDaoJdbc
64: .copyCurrentAccountsToPriorYearTable();
65: if (LOG.isInfoEnabled()) {
66: LOG
67: .info("number of current year accounts copied to prior year : "
68: + copiedCount);
69: }
70: }
71:
72: /**
73: * This method sets the local dao variable to the value provided.
74: *
75: * @param priorYearAccountDao The priorYearAccountDao to set.
76: */
77: public void setPriorYearAccountDao(
78: PriorYearAccountDao priorYearAccountDao) {
79: this .priorYearAccountDao = priorYearAccountDao;
80: }
81:
82: /**
83: * This method sets the local dao jdbc variable to the value provided.
84: *
85: * @param priorYearAccountDaoJdbc The priorYearAccountDaoJdbc to set.
86: */
87: public void setPriorYearAccountDaoJdbc(
88: PriorYearAccountDaoJdbc priorYearAccountDaoJdbc) {
89: this.priorYearAccountDaoJdbc = priorYearAccountDaoJdbc;
90: }
91: }
|