01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.gl.dao;
17:
18: import java.util.Date;
19: import java.util.Iterator;
20:
21: import org.kuali.module.gl.bo.Reversal;
22: import org.kuali.module.gl.bo.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: * Saves a reversal record
30: *
31: * @param re a reversal to save
32: */
33: public void save(Reversal re);
34:
35: /**
36: * Find the maximum transactionLedgerEntrySequenceNumber in the entry table for a specific transaction. This is used to make
37: * sure that rows added have a unique primary key.
38: *
39: * @param t a transaction to find the maximum sequence number for
40: * @return the max sequence number for the given transaction
41: */
42: public int getMaxSequenceNumber(Transaction t);
43:
44: /**
45: * Looks up the reversal that matches the keys from the given transaction
46: *
47: * @param t the given transaction
48: * @return the reversal that matches the keys of that transaction
49: */
50: public Reversal getByTransaction(Transaction t);
51:
52: /**
53: * Returns all reversals that should have reversed on or before the given date
54: *
55: * @param before the date that reversals retrieved should reverse on or before
56: * @return an iterator of reversal records
57: */
58: public Iterator getByDate(Date before);
59:
60: /**
61: * Deletes a reversal record
62: *
63: * @param re a reversal to delete
64: */
65: public void delete(Reversal re);
66: }
|