001: /*
002: * Copyright 2006-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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.module.gl.service.impl;
017:
018: import java.util.Collection;
019:
020: import org.kuali.kfs.KFSConstants;
021: import org.kuali.module.gl.bo.SufficientFundRebuild;
022: import org.kuali.module.gl.dao.SufficientFundRebuildDao;
023: import org.kuali.module.gl.service.SufficientFundRebuildService;
024: import org.springframework.transaction.annotation.Transactional;
025:
026: /**
027: * The default implementation of SufficientFundRebuildService
028: */
029: @Transactional
030: public class SufficientFundRebuildServiceImpl implements
031: SufficientFundRebuildService {
032: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
033: .getLogger(SufficientFundRebuildServiceImpl.class);
034:
035: SufficientFundRebuildDao sufficientFundRebuildDao;
036:
037: /**
038: * Returns all sufficient funds records in the persistence store. Defers to the DAO.
039: *
040: * @return a Collection of all sufficient fund rebuild records
041: * @see org.kuali.module.gl.service.SufficientFundRebuildService#getAll()
042: */
043: public Collection getAll() {
044: LOG.debug("getAll() started");
045:
046: return sufficientFundRebuildDao.getAll();
047: }
048:
049: /**
050: * Returns all sufficient fund rebuild records using account numbers. Defers to the DAO.
051: *
052: * @return a Collection of sufficient fund rebuild records
053: * @see org.kuali.module.gl.service.SufficientFundRebuildService#getAllAccountEntries()
054: */
055: public Collection getAllAccountEntries() {
056: LOG.debug("getAllAccountEntries() started");
057:
058: return sufficientFundRebuildDao
059: .getByType(KFSConstants.SF_TYPE_ACCOUNT);
060: }
061:
062: /**
063: * Returns all sufficient fund rebuild records using object codes. Defers to the DAO.
064: *
065: * @return a Collection of sufficient fund rebuild records
066: * @see org.kuali.module.gl.service.SufficientFundRebuildService#getAllObjectEntries()
067: */
068: public Collection getAllObjectEntries() {
069: LOG.debug("getAllObjectEntries() started");
070:
071: return sufficientFundRebuildDao
072: .getByType(KFSConstants.SF_TYPE_OBJECT);
073: }
074:
075: /**
076: * Returns a sufficient fund rebuild record given the parameters as keys. Defers to the DAO.
077: *
078: * @param chartOfAccountsCode the chart of the record to return
079: * @param accountNumberFinancialObjectCode either an account number or an object code of the sufficient fund rebuild record to return
080: * @return the qualifying sufficient fund rebuild record, or null if not found
081: * @see org.kuali.module.gl.service.SufficientFundRebuildService#getByAccount(java.lang.String, java.lang.String)
082: */
083: public SufficientFundRebuild getByAccount(
084: String chartOfAccountsCode,
085: String accountNumberFinancialObjectCode) {
086: LOG.debug("getByAccount() started");
087:
088: return sufficientFundRebuildDao.getByAccount(
089: chartOfAccountsCode, accountNumberFinancialObjectCode);
090: }
091:
092: /**
093: * Returns a sufficient fund rebuild record, based on the given keys. Defers to the DAO.
094: *
095: * @param chartOfAccountsCode the chart of the sufficient fund rebuild record to return
096: * @param accountFinancialObjectTypeCode if the record has an object code, the object code of the sufficient fund rebuild record to return
097: * @param accountNumberFinancialObjectCode if the record has an account number, the account number of the sufficient fund rebuild record to return
098: * @return the qualifying sufficient fund rebuild record, or null if not found
099: * @see org.kuali.module.gl.service.SufficientFundRebuildService#get(java.lang.String, java.lang.String, java.lang.String)
100: */
101: public SufficientFundRebuild get(String chartOfAccountsCode,
102: String accountFinancialObjectTypeCode,
103: String accountNumberFinancialObjectCode) {
104: LOG.debug("get() started");
105:
106: return sufficientFundRebuildDao.get(chartOfAccountsCode,
107: accountFinancialObjectTypeCode,
108: accountNumberFinancialObjectCode);
109: }
110:
111: /**
112: * Saves a sufficient fund rebuild record to the persistence store. Defers to the DAO.
113: *
114: * @param sfrb the sufficient fund rebuild record to save
115: * @see org.kuali.module.gl.service.SufficientFundRebuildService#save(org.kuali.module.gl.bo.SufficientFundRebuild)
116: */
117: public void save(SufficientFundRebuild sfrb) {
118: LOG.debug("save() started");
119:
120: sufficientFundRebuildDao.save(sfrb);
121: }
122:
123: /**
124: * Deletes a SufficientFundRebuild record from the persistence store. Defers to the DAO.
125: *
126: * @param sfrb the sufficient fund rebuild record to delete
127: * @see org.kuali.module.gl.service.SufficientFundRebuildService#delete(org.kuali.module.gl.bo.SufficientFundRebuild)
128: */
129: public void delete(SufficientFundRebuild sfrb) {
130: LOG.debug("delete() started");
131:
132: sufficientFundRebuildDao.delete(sfrb);
133: }
134:
135: public void setSufficientFundRebuildDao(
136: SufficientFundRebuildDao sufficientFundRebuildDao) {
137: this.sufficientFundRebuildDao = sufficientFundRebuildDao;
138: }
139: }
|