View Javadoc
1   /*
2    * Copyright 2007 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.sys.service.impl;
17  
18  import java.util.List;
19  
20  import org.kuali.ole.sys.dataaccess.AccountingLineDao;
21  import org.kuali.ole.sys.service.AccountingLineService;
22  import org.kuali.ole.sys.service.NonTransactional;
23  
24  /**
25   * This class is the service implementation for the AccountingLine structure. This has been created with polymorphism in mind so
26   * that this service can be used for performing services for both the Source and Target AccountingLineBase structures. This is the
27   * default, Kuali provided implementation.
28   */
29  
30  @NonTransactional
31  public class AccountingLineServiceImpl implements AccountingLineService {
32      // set up logging
33      private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(AccountingLineServiceImpl.class);
34  
35      private AccountingLineDao accountingLineDao;
36  
37      /**
38       * Default constructor
39       */
40      public AccountingLineServiceImpl() {
41          super();
42      }
43  
44      /**
45       * Retrieves an accounting line by its document header id. Will retrieve any object that extends AccountingLineBase (i.e. Source
46       * and Target lines).
47       * 
48       * @param Class The specific child class type to be retrieved.
49       * @param Long
50       */
51      public List getByDocumentHeaderId(Class clazz, String documentHeaderId) {
52          // retrieve the line
53          return getAccountingLineDao().findByDocumentHeaderId(clazz, documentHeaderId);
54      }
55  
56  
57      // needed for Spring injection
58      /**
59       * Sets the data access object
60       * 
61       * @param d
62       */
63      public void setAccountingLineDao(AccountingLineDao d) {
64          this.accountingLineDao = d;
65      }
66  
67      /**
68       * Retrieves a data access object
69       */
70      public AccountingLineDao getAccountingLineDao() {
71          return accountingLineDao;
72      }
73  }