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.fp.service.impl;
17  
18  import java.util.Collection;
19  
20  import org.apache.log4j.Logger;
21  import org.kuali.ole.fp.businessobject.CheckBase;
22  import org.kuali.ole.fp.dataaccess.CheckDao;
23  import org.kuali.ole.fp.service.CheckService;
24  import org.kuali.ole.sys.service.NonTransactional;
25  
26  /**
27   * 
28   * This is the default implementation of the CheckService interface.
29   */
30  
31  @NonTransactional
32  public class CheckServiceImpl implements CheckService {
33      // set up logging
34      private static final Logger LOG = Logger.getLogger(CheckServiceImpl.class);
35  
36      protected CheckDao checkDao;
37  
38      /**
39       * Retrieves a List of Checks by using the document header id given to retrieve a document and then 
40       * retrieving all checks associated with that document.
41       * 
42       * @param documentHeaderId The document header id to use to find the associated collection of checks.
43       * @return A collection of checks associated with a document with the provided document header id.
44       */
45      public Collection<CheckBase> getByDocumentHeaderId(String documentHeaderId) {
46          // retrieve the check
47          return checkDao.findByDocumentHeaderId(documentHeaderId);
48      }
49  
50      // Spring injection
51      /**
52       * Sets the checkDao attribute.
53       * @param The CheckDao to be set.
54       */
55      public void setCheckDao(CheckDao d) {
56          this.checkDao = d;
57      }
58  
59      /**
60       * Gets the checkDao attribute.
61       * @return An instance of the checkDao attribute.
62       */
63      public CheckDao getCheckDao() {
64          return checkDao;
65      }
66  }