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.gl.dataaccess;
017    
018    import java.util.Collection;
019    
020    import org.kuali.kfs.gl.businessobject.SufficientFundBalances;
021    
022    /**
023     * A DAO interface declaring methods needed to help SufficientFundBalance records interact with the database
024     */
025    public interface SufficientFundBalancesDao {
026        /**
027         * Fetches sufficient fund balances based on given keys of fiscal year, chart code, and object code
028         * 
029         * @param universityFiscalYear the university fiscal year of sufficient fund balances to find
030         * @param chartOfAccountsCode the chart of accounts code of sufficient fund balances to find
031         * @param financialObjectCode the object code of sufficient fund balances to find
032         * @return a Collection of sufficient fund balances, qualified by the parameter values
033         */
034        public Collection getByObjectCode(Integer universityFiscalYear, String chartOfAccountsCode, String financialObjectCode);
035    
036        /**
037         * Deletes sufficient fund balances associated with a given year, chart, and account number
038         * 
039         * @param universityFiscalYear the university fiscal year of sufficient fund balances to delete
040         * @param chartOfAccountsCode the chart code of sufficient fund balances to delete
041         * @param accountNumber the account number of sufficient fund balances to delete
042         * @return the number of records deleted
043         */
044        public int deleteByAccountNumber(Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber);
045    
046        /**
047         * Returns a sufficient fund balance by its primary key values
048         * 
049         * @param universityFiscalYear the university fiscal year of the sufficient funds balance to return
050         * @param chartOfAccountsCode the chart of accounts code of the sufficient funds balance to return
051         * @param accountNumber the account number of the sufficient funds balance to return
052         * @param financialObjectCode the object code of the sufficient funds balance to return
053         * @return the qualifying sufficient funds balance record, or null no suitable record can be found
054         */
055        public SufficientFundBalances getByPrimaryId(Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, String financialObjectCode);
056    
057        /**
058         * Save a sufficient funds balance
059         * 
060         * @param sfb the sufficient funds balance to save
061         */
062        public void save(SufficientFundBalances sfb);
063    
064        /**
065         * This method should only be used in unit tests. It loads all the gl_sf_balances_t rows in memory into a collection. This won't
066         * sace for production.
067         * 
068         * @return a Collection with all sufficient funds balances in the database
069         */
070        public Collection testingGetAllEntries();
071    }