001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     * http://www.opensource.org/licenses/ecl2.php
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.kfs.sys.service.impl;
017    
018    import java.util.List;
019    
020    import org.kuali.kfs.sys.dataaccess.AccountingLineDao;
021    import org.kuali.kfs.sys.service.AccountingLineService;
022    import org.kuali.kfs.sys.service.NonTransactional;
023    
024    /**
025     * This class is the service implementation for the AccountingLine structure. This has been created with polymorphism in mind so
026     * that this service can be used for performing services for both the Source and Target AccountingLineBase structures. This is the
027     * default, Kuali provided implementation.
028     */
029    
030    @NonTransactional
031    public class AccountingLineServiceImpl implements AccountingLineService {
032        // set up logging
033        private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(AccountingLineServiceImpl.class);
034    
035        private AccountingLineDao accountingLineDao;
036    
037        /**
038         * Default constructor
039         */
040        public AccountingLineServiceImpl() {
041            super();
042        }
043    
044        /**
045         * Retrieves an accounting line by its document header id. Will retrieve any object that extends AccountingLineBase (i.e. Source
046         * and Target lines).
047         * 
048         * @param Class The specific child class type to be retrieved.
049         * @param Long
050         */
051        public List getByDocumentHeaderId(Class clazz, String documentHeaderId) {
052            // retrieve the line
053            return getAccountingLineDao().findByDocumentHeaderId(clazz, documentHeaderId);
054        }
055    
056    
057        // needed for Spring injection
058        /**
059         * Sets the data access object
060         * 
061         * @param d
062         */
063        public void setAccountingLineDao(AccountingLineDao d) {
064            this.accountingLineDao = d;
065        }
066    
067        /**
068         * Retrieves a data access object
069         */
070        public AccountingLineDao getAccountingLineDao() {
071            return accountingLineDao;
072        }
073    }