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.financial.service.impl;
17:
18: import java.util.List;
19:
20: import org.apache.log4j.Logger;
21: import org.kuali.module.financial.bo.Check;
22: import org.kuali.module.financial.dao.CheckDao;
23: import org.kuali.module.financial.service.CheckService;
24: import org.springframework.transaction.annotation.Transactional;
25:
26: /**
27: *
28: * This is the default implementation of the CheckService interface.
29: */
30: @Transactional
31: public class CheckServiceImpl implements CheckService {
32: // set up logging
33: private static Logger LOG = Logger
34: .getLogger(CheckServiceImpl.class);
35:
36: private CheckDao checkDao;
37:
38: /**
39: * Saves a check to the database.
40: *
41: * @param check The check to be saved.
42: * @return An instance of the check which was just saved.
43: */
44: public Check save(Check check) {
45: checkDao.save(check);
46:
47: return check;
48: }
49:
50: /**
51: * Deletes a check from the database.
52: *
53: * @param check The check to be deleted.
54: */
55: public void deleteCheck(Check check) {
56: checkDao.deleteCheck(check);
57: }
58:
59: /**
60: * Retrieves a List of Checks by using the document header id given to retrieve a document and then
61: * retrieving all checks associated with that document.
62: *
63: * @param documentHeaderId The document header id to use to find the associated collection of checks.
64: * @return A collection of checks associated with a document with the provided document header id.
65: */
66: public List getByDocumentHeaderId(String documentHeaderId) {
67: // retrieve the check
68: return checkDao.findByDocumentHeaderId(documentHeaderId);
69: }
70:
71: // Spring injection
72: /**
73: * Sets the checkDao attribute.
74: * @param The CheckDao to be set.
75: */
76: public void setCheckDao(CheckDao d) {
77: this .checkDao = d;
78: }
79:
80: /**
81: * Gets the checkDao attribute.
82: * @return An instance of the checkDao attribute.
83: */
84: public CheckDao getCheckDao() {
85: return checkDao;
86: }
87: }
|