View Javadoc
1   /*
2    * Copyright 2006 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.gl.service.impl;
17  
18  import java.util.Map;
19  
20  import org.kuali.ole.gl.OJBUtility;
21  import org.kuali.ole.gl.businessobject.Entry;
22  import org.kuali.ole.gl.dataaccess.EntryDao;
23  import org.kuali.ole.gl.service.EntryService;
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.getLogger(EntryServiceImpl.class);
32  
33      private EntryDao entryDao;
34  
35      /**
36       * Purge the entry table by year/chart
37       * 
38       * @param chart chart of entries to purge
39       * @param year fiscal year of entries to purge
40       * @see org.kuali.ole.gl.service.EntryService#purgeYearByChart(java.lang.String, int)
41       */
42      public void purgeYearByChart(String chart, int year) {
43          LOG.debug("purgeYearByChart() started");
44  
45          entryDao.purgeYearByChart(chart, year);
46      }
47  
48      public void setEntryDao(EntryDao entryDao) {
49          this.entryDao = entryDao;
50      }
51  
52      /**
53       * This method gets the number of GL entries according to input fields and values
54       * 
55       * @param fieldValues the input fields and values
56       * @return the number of the open encumbrances
57       * @see org.kuali.ole.gl.service.EntryService#getEntryRecordCount(java.util.Map)
58       */
59      public Integer getEntryRecordCount(Map fieldValues) {
60          return OJBUtility.getResultSizeFromMap(fieldValues, new Entry()).intValue();
61      }
62  }