View Javadoc
1   /*
2    * Copyright 2006 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.Date;
19  import java.util.Iterator;
20  
21  import org.kuali.ole.gl.businessobject.Reversal;
22  import org.kuali.ole.gl.businessobject.Transaction;
23  
24  /**
25   * An interface that declares the methods needed for reversal services to interact with the database
26   */
27  public interface ReversalDao {
28  
29      /**
30       * Find the maximum transactionLedgerEntrySequenceNumber in the entry table for a specific transaction. This is used to make
31       * sure that rows added have a unique primary key.
32       * 
33       * @param t a transaction to find the maximum sequence number for
34       * @return the max sequence number for the given transaction
35       */
36      public int getMaxSequenceNumber(Transaction t);
37  
38      /**
39       * Looks up the reversal that matches the keys from the given transaction
40       * 
41       * @param t the given transaction
42       * @return the reversal that matches the keys of that transaction
43       */
44      public Reversal getByTransaction(Transaction t);
45  
46      /**
47       * Returns all reversals that should have reversed on or before the given date
48       * 
49       * @param before the date that reversals retrieved should reverse on or before
50       * @return an iterator of reversal records
51       */
52      public Iterator getByDate(Date before);
53  
54      /**
55       * Deletes a reversal record
56       * 
57       * @param re a reversal to delete
58       */
59      public void delete(Reversal re);
60  }