KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > ejb > jdo > Transaction


1 package test.ejb.jdo;
2
3 import java.util.Date JavaDoc;
4 import java.util.Vector JavaDoc;
5
6 /**
7  * A simple test class to test for generation of Castor's mapping.xml.
8  *
9  * @castor.class
10  * id="reference"
11  * table="tx"
12  * @version $Revision: 1.4 $
13  * @author Dmitri Colebatch (dim@bigpond.net.au)
14  */

15 public class Transaction
16 {
17     /**
18      * The tx reference - also the tx's id.
19      */

20     private int reference;
21
22     /**
23      * The tx amount.
24      */

25     private double amount;
26
27     /**
28      * The 'from' account id.
29      */

30     private int fromAccountId;
31
32     /**
33      * The 'to' account id.
34      */

35     private int toAccountId;
36
37     /**
38      * The date of the tx.
39      */

40     private Date JavaDoc date;
41
42     /**
43      * Silly field - a tx has a collection of staff that are involved in it.
44      */

45     private Vector JavaDoc staff;
46
47     /**
48      * @castor.field
49      * @castor.field-sql
50      * type="integer"
51      * @castor.field-xml
52      */

53     public int getReference()
54     {
55         return reference;
56     }
57
58     /**
59      */

60     public void setReference(int reference)
61     {
62         this.reference = reference;
63     }
64
65     /**
66      * @castor.field
67      * @castor.field-sql
68      * type="float"
69      * @castor.field-xml
70      */

71     public double getAmount()
72     {
73         return amount;
74     }
75
76     /**
77      */

78     public void setAmount(double amount)
79     {
80         this.amount = amount;
81     }
82
83     /**
84      * @castor.field
85      * @castor.field-sql
86      * type="integer"
87      * @castor.field-xml
88      */

89     public int getFromAccountId()
90     {
91         return fromAccountId;
92     }
93
94     /**
95      */

96     public void setFromAccountId(int fromAccountId)
97     {
98         this.fromAccountId = fromAccountId;
99     }
100
101     /**
102      * @castor.field
103      * @castor.field-sql
104      * type="integer"
105      * @castor.field-xml
106      */

107     public int getToAccountId()
108     {
109         return toAccountId;
110     }
111
112     /**
113      */

114     public void setToAccountId(int toAccountId)
115     {
116         this.toAccountId = toAccountId;
117     }
118
119     /**
120      * @castor.field
121      * @castor.field-sql
122      * type="date"
123      * @castor.field-xml
124      */

125     public Date JavaDoc getDate()
126     {
127         return date;
128     }
129
130     /**
131      */

132     public void setDate(Date JavaDoc date)
133     {
134         this.date = date;
135     }
136
137     /**
138      * @castor.field collection="vector" type="test.ejb.jdo.Staff"
139      */

140     public Vector JavaDoc getStaff()
141     {
142         return staff;
143     }
144
145     public void setStaff(Vector JavaDoc staff)
146     {
147         this.staff = staff;
148     }
149 }
150
Popular Tags