KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > interfaces > AccountData


1 /*
2  * Generated by XDoclet - Do not edit!
3  */

4 package test.interfaces;
5
6 /**
7  * Data object for Account.
8  * @xdoclet-generated at 16-04-05
9  * @copyright The XDoclet Team
10  * @author XDoclet
11  * @version 1.2.3
12  */

13 public class AccountData
14    extends java.lang.Object JavaDoc
15    implements java.io.Serializable JavaDoc
16 {
17    private java.lang.Integer JavaDoc id;
18    private test.interfaces.Customer owner;
19    private float balance;
20    private java.util.Date JavaDoc lastModificationDate;
21    private java.lang.String JavaDoc accountId;
22    private java.util.Date JavaDoc creationDate;
23
24   /* begin value object */
25    private test.interfaces.AccountValue AccountValue = null;
26
27    public test.interfaces.AccountValue getAccountValue()
28    {
29       if( AccountValue == null )
30       {
31           AccountValue = new test.interfaces.AccountValue();
32       }
33       try
34          {
35             AccountValue.setId( getId() );
36             AccountValue.setBalance( getBalance() );
37                    }
38          catch (Exception JavaDoc e)
39          {
40             throw new javax.ejb.EJBException JavaDoc(e);
41          }
42
43       return AccountValue;
44    }
45
46    public void setAccountValue( test.interfaces.AccountValue valueHolder )
47    {
48
49       try
50       {
51          setBalance( valueHolder.getBalance() );
52       }
53       catch (Exception JavaDoc e)
54       {
55          throw new javax.ejb.EJBException JavaDoc(e);
56       }
57    }
58
59   /* end value object */
60
61    public AccountData()
62    {
63    }
64
65    public AccountData( java.lang.Integer JavaDoc id,test.interfaces.Customer owner,float balance,java.util.Date JavaDoc lastModificationDate,java.lang.String JavaDoc accountId,java.util.Date JavaDoc creationDate )
66    {
67       setId(id);
68       setOwner(owner);
69       setBalance(balance);
70       setLastModificationDate(lastModificationDate);
71       this.accountId = accountId;
72       setCreationDate(creationDate);
73    }
74
75    public AccountData( AccountData otherData )
76    {
77       setId(otherData.getId());
78       setOwner(otherData.getOwner());
79       setBalance(otherData.getBalance());
80       setLastModificationDate(otherData.getLastModificationDate());
81       this.accountId = otherData.accountId;
82       setCreationDate(otherData.getCreationDate());
83
84    }
85
86    public test.interfaces.AccountPK getPrimaryKey() {
87      test.interfaces.AccountPK pk = new test.interfaces.AccountPK(this.getId());
88      return pk;
89    }
90
91    public java.lang.Integer JavaDoc getId()
92    {
93       return this.id;
94    }
95    public void setId( java.lang.Integer JavaDoc id )
96    {
97       this.id = id;
98    }
99
100    public test.interfaces.Customer getOwner()
101    {
102       return this.owner;
103    }
104    public void setOwner( test.interfaces.Customer owner )
105    {
106       this.owner = owner;
107    }
108
109    public float getBalance()
110    {
111       return this.balance;
112    }
113    public void setBalance( float balance )
114    {
115       this.balance = balance;
116    }
117
118    public java.util.Date JavaDoc getLastModificationDate()
119    {
120       return this.lastModificationDate;
121    }
122    public void setLastModificationDate( java.util.Date JavaDoc lastModificationDate )
123    {
124       this.lastModificationDate = lastModificationDate;
125    }
126
127    public java.lang.String JavaDoc getAccountId()
128    {
129       return this.accountId;
130    }
131    public void setAccountId( java.lang.String JavaDoc accountId )
132    {
133       this.accountId = accountId;
134    }
135
136    public java.util.Date JavaDoc getCreationDate()
137    {
138       return this.creationDate;
139    }
140    public void setCreationDate( java.util.Date JavaDoc creationDate )
141    {
142       this.creationDate = creationDate;
143    }
144
145    public String JavaDoc toString()
146    {
147       StringBuffer JavaDoc str = new StringBuffer JavaDoc("{");
148
149       str.append("id=" + getId() + " " + "owner=" + getOwner() + " " + "balance=" + getBalance() + " " + "lastModificationDate=" + getLastModificationDate() + " " + "accountId=" + getAccountId() + " " + "creationDate=" + getCreationDate());
150       str.append('}');
151
152       return(str.toString());
153    }
154
155    public boolean equals( Object JavaDoc pOther )
156    {
157       if( pOther instanceof AccountData )
158       {
159          AccountData lTest = (AccountData) pOther;
160          boolean lEquals = true;
161
162          if( this.id == null )
163          {
164             lEquals = lEquals && ( lTest.id == null );
165          }
166          else
167          {
168             lEquals = lEquals && this.id.equals( lTest.id );
169          }
170          if( this.owner == null )
171          {
172             lEquals = lEquals && ( lTest.owner == null );
173          }
174          else
175          {
176             lEquals = lEquals && this.owner.equals( lTest.owner );
177          }
178          lEquals = lEquals && this.balance == lTest.balance;
179          if( this.lastModificationDate == null )
180          {
181             lEquals = lEquals && ( lTest.lastModificationDate == null );
182          }
183          else
184          {
185             lEquals = lEquals && this.lastModificationDate.equals( lTest.lastModificationDate );
186          }
187          if( this.accountId == null )
188          {
189             lEquals = lEquals && ( lTest.accountId == null );
190          }
191          else
192          {
193             lEquals = lEquals && this.accountId.equals( lTest.accountId );
194          }
195          if( this.creationDate == null )
196          {
197             lEquals = lEquals && ( lTest.creationDate == null );
198          }
199          else
200          {
201             lEquals = lEquals && this.creationDate.equals( lTest.creationDate );
202          }
203
204          return lEquals;
205       }
206       else
207       {
208          return false;
209       }
210    }
211
212    public int hashCode()
213    {
214       int result = 17;
215
216       result = 37*result + ((this.id != null) ? this.id.hashCode() : 0);
217
218       result = 37*result + ((this.owner != null) ? this.owner.hashCode() : 0);
219
220       result = 37*result + Float.floatToIntBits(balance);
221
222       result = 37*result + ((this.lastModificationDate != null) ? this.lastModificationDate.hashCode() : 0);
223
224       result = 37*result + ((this.accountId != null) ? this.accountId.hashCode() : 0);
225
226       result = 37*result + ((this.creationDate != null) ? this.creationDate.hashCode() : 0);
227
228       return result;
229    }
230
231 }
232
Popular Tags