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.gl.service.impl;
17:
18: import java.util.Map;
19:
20: import org.kuali.module.gl.bo.Entry;
21: import org.kuali.module.gl.dao.EntryDao;
22: import org.kuali.module.gl.service.EntryService;
23: import org.kuali.module.gl.util.OJBUtility;
24: import org.springframework.transaction.annotation.Transactional;
25:
26: /**
27: * The base implementation of EntryService
28: */
29: @Transactional
30: public class EntryServiceImpl implements EntryService {
31: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
32: .getLogger(EntryServiceImpl.class);
33:
34: private EntryDao entryDao;
35:
36: /**
37: * Purge the entry table by year/chart
38: *
39: * @param chart chart of entries to purge
40: * @param year fiscal year of entries to purge
41: * @see org.kuali.module.gl.service.EntryService#purgeYearByChart(java.lang.String, int)
42: */
43: public void purgeYearByChart(String chart, int year) {
44: LOG.debug("purgeYearByChart() started");
45:
46: entryDao.purgeYearByChart(chart, year);
47: }
48:
49: public void setEntryDao(EntryDao entryDao) {
50: this .entryDao = entryDao;
51: }
52:
53: /**
54: * This method gets the number of GL entries according to input fields and values
55: *
56: * @param fieldValues the input fields and values
57: * @return the number of the open encumbrances
58: * @see org.kuali.module.gl.service.EntryService#getEntryRecordCount(java.util.Map)
59: */
60: public Integer getEntryRecordCount(Map fieldValues) {
61: return OJBUtility
62: .getResultSizeFromMap(fieldValues, new Entry())
63: .intValue();
64: }
65: }
|