View Javadoc
1   /*
2    * Copyright 2005 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
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.ole.gl.dataaccess;
17  
18  import java.util.Iterator;
19  import java.util.Map;
20  
21  import org.kuali.ole.gl.businessobject.Encumbrance;
22  import org.kuali.ole.gl.businessobject.Transaction;
23  
24  /**
25   * A DAO interface that declares methods needed for Encumbrances to interact with the database
26   */
27  public interface EncumbranceDao {
28      /**
29       * Returns an encumbrance that would be affected by the given transaction
30       * 
31       * @param t the transaction to find the affected encumbrance for
32       * @return an Encumbrance that would be affected by the posting of the transaction, or null
33       */
34      public Encumbrance getEncumbranceByTransaction(Transaction t);
35  
36      /**
37       * Returns an Iterator of all encumbrances that need to be closed for the fiscal year
38       * 
39       * @param fiscalYear a fiscal year to find encumbrances for
40       * @return an Iterator of encumbrances to close
41       */
42      public Iterator getEncumbrancesToClose(Integer fiscalYear);
43  
44      /**
45       * Purges the database of all those encumbrances with the given chart and year 
46       * 
47       * @param chartOfAccountsCode the chart of accounts code purged encumbrances will have
48       * @param year the university fiscal year purged encumbrances will have
49       */
50      public void purgeYearByChart(String chartOfAccountsCode, int year);
51  
52      /**
53       * fetch all encumbrance records from GL open encumbrance table
54       * 
55       * @return an Iterator with all encumbrances currently in the database
56       */
57      public Iterator getAllEncumbrances();
58  
59      /**
60       * group all encumbrances with/without the given document type code by fiscal year, chart, account, sub-account, object code,
61       * sub object code, and balance type code, and summarize the encumbrance amount and the encumbrance close amount.
62       * 
63       * @param documentTypeCode the given document type code
64       * @param included indicate if all encumbrances with the given document type are included in the results or not
65       * @return an Iterator of arrays of java.lang.Objects holding summarization data about qualifying encumbrances 
66       */
67      public Iterator getSummarizedEncumbrances(String documentTypeCode, boolean included);
68  
69      /**
70       * This method finds the open encumbrances according to input fields and values
71       * 
72       * @param fieldValues the input fields and values
73       * @param includeZeroEncumbrances should the query include encumbrances which have zeroed out?
74       * @return a collection of open encumbrances
75       */
76      public Iterator findOpenEncumbrance(Map fieldValues, boolean includeZeroEncumbrances);
77  
78      /**
79       * Counts the number of the open encumbrances according to input fields and values
80       * 
81       * @param fieldValues the input fields and values
82       * @param includeZeroEncumbrances should the query include encumbrances which have zeroed out?
83       * @return the number of the open encumbrances
84       */
85      public Integer getOpenEncumbranceRecordCount(Map fieldValues, boolean includeZeroEncumbrances);
86      
87      /**
88       * @param year the given university fiscal year
89       * @return count of rows for the given fiscal year
90       */
91      public Integer findCountGreaterOrEqualThan(Integer year);
92  }