01: /*
02: * Copyright 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.kfs.service.impl;
17:
18: import java.util.List;
19:
20: import org.kuali.kfs.bo.AccountingLine;
21: import org.kuali.kfs.dao.AccountingLineDao;
22: import org.kuali.kfs.service.AccountingLineService;
23: import org.springframework.transaction.annotation.Transactional;
24:
25: /**
26: * This class is the service implementation for the AccountingLine structure. This has been created with polymorphism in mind so
27: * that this service can be used for performing services for both the Source and Target AccountingLineBase structures. This is the
28: * default, Kuali provided implementation.
29: */
30: @Transactional
31: public class AccountingLineServiceImpl implements AccountingLineService {
32: // set up logging
33: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
34: .getLogger(AccountingLineServiceImpl.class);
35:
36: private AccountingLineDao accountingLineDao;
37:
38: /**
39: * Default constructor
40: */
41: public AccountingLineServiceImpl() {
42: super ();
43: }
44:
45: /**
46: * Saves an accounting line to the DB.
47: *
48: * @param AccountingLine The accounting line object to save - can be any object that extends AccountingLineBase (i.e. Source and
49: * Target lines).
50: */
51: public AccountingLine save(AccountingLine line) {
52: accountingLineDao.save(line);
53: return line;
54: }
55:
56: /**
57: * Deletes an accounting line from the DB.
58: *
59: * @param AccountingLine The accounting line object to save - can be any object that extends AccountingLineBase (i.e. Source and
60: * Target lines).
61: */
62: public void deleteAccountingLine(AccountingLine line) {
63: accountingLineDao.deleteAccountingLine(line);
64: }
65:
66: /**
67: * Retrieves an accounting line by its document header id. Will retrieve any object that extends AccountingLineBase (i.e. Source
68: * and Target lines).
69: *
70: * @param Class The specific child class type to be retrieved.
71: * @param Long
72: */
73: public List getByDocumentHeaderId(Class clazz,
74: String documentHeaderId) {
75: // retrieve the line
76: return getAccountingLineDao().findByDocumentHeaderId(clazz,
77: documentHeaderId);
78: }
79:
80: // needed for Spring injection
81: /**
82: * Sets the data access object
83: *
84: * @param d
85: */
86: public void setAccountingLineDao(AccountingLineDao d) {
87: this .accountingLineDao = d;
88: }
89:
90: /**
91: * Retrieves a data access object
92: */
93: public AccountingLineDao getAccountingLineDao() {
94: return accountingLineDao;
95: }
96: }
|