KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > interfaces > CustomerData


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

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

13 public class CustomerData
14    extends test.interfaces.PersonData
15    implements java.io.Serializable JavaDoc
16 {
17    private float credit;
18    private java.lang.String JavaDoc[][] array;
19    private byte[] image;
20    private float tax;
21
22   /* begin value object */
23    private test.interfaces.CustomerLightValue CustomerLightValue = null;
24
25    public test.interfaces.CustomerLightValue getCustomerLightValue()
26    {
27       if( CustomerLightValue == null )
28       {
29           CustomerLightValue = new test.interfaces.CustomerLightValue();
30       }
31       try
32          {
33             CustomerLightValue.setCredit( getCredit() );
34             CustomerLightValue.setId( getId() );
35                    }
36          catch (Exception JavaDoc e)
37          {
38             throw new javax.ejb.EJBException JavaDoc(e);
39          }
40
41       return CustomerLightValue;
42    }
43    private test.interfaces.CustomerNormalValue CustomerNormalValue = null;
44
45    public test.interfaces.CustomerNormalValue getCustomerNormalValue()
46    {
47       if( CustomerNormalValue == null )
48       {
49           CustomerNormalValue = new test.interfaces.CustomerNormalValue();
50       }
51       try
52          {
53             CustomerNormalValue.setCredit( getCredit() );
54             CustomerNormalValue.setId( getId() );
55             CustomerNormalValue.setName( getName() );
56             CustomerNormalValue.setFirstName( getFirstName() );
57                    }
58          catch (Exception JavaDoc e)
59          {
60             throw new javax.ejb.EJBException JavaDoc(e);
61          }
62
63       return CustomerNormalValue;
64    }
65    private test.interfaces.CustomerValue CustomerValue = null;
66
67    public test.interfaces.CustomerValue getCustomerValue()
68    {
69       if( CustomerValue == null )
70       {
71           CustomerValue = new test.interfaces.CustomerValue();
72       }
73       try
74          {
75             CustomerValue.setCredit( getCredit() );
76             CustomerValue.setId( getId() );
77             CustomerValue.setName( getName() );
78             CustomerValue.setFirstName( getFirstName() );
79             CustomerValue.setPhone( getPhone() );
80             CustomerValue.setFax( getFax() );
81                    }
82          catch (Exception JavaDoc e)
83          {
84             throw new javax.ejb.EJBException JavaDoc(e);
85          }
86
87       return CustomerValue;
88    }
89
90    public void setCustomerNormalValue( test.interfaces.CustomerNormalValue valueHolder )
91    throws test.interfaces.ApplicationException{
92       if( getVersion() != valueHolder.getVersion() )
93          throw new IllegalStateException JavaDoc( "Wrong version. Had " + getVersion() + ", got " + valueHolder.getVersion() );
94
95       try
96       {
97          setCredit( valueHolder.getCredit() );
98          setName( valueHolder.getName() );
99          setFirstName( valueHolder.getFirstName() );
100       }
101       catch (Exception JavaDoc e)
102       {
103          throw new javax.ejb.EJBException JavaDoc(e);
104       }
105    }
106
107   /* end value object */
108
109    private long _version = 0;
110
111    public CustomerData()
112    {
113    }
114
115    public CustomerData( float credit,java.lang.String JavaDoc[][] array,byte[] image,float tax,java.lang.String JavaDoc id,java.lang.String JavaDoc name,java.lang.String JavaDoc firstName,java.lang.String JavaDoc phone,java.lang.String JavaDoc fax,java.util.Date JavaDoc creationDate )
116    {
117       setCredit(credit);
118       this.array = array;
119       this.image = image;
120       this.tax = tax;
121       setId(id);
122       setName(name);
123       setFirstName(firstName);
124       setPhone(phone);
125       setFax(fax);
126       setCreationDate(creationDate);
127    }
128
129    public CustomerData( CustomerData otherData )
130    {
131       setCredit(otherData.getCredit());
132       this.array = otherData.array;
133       this.image = otherData.image;
134       this.tax = otherData.tax;
135       setId(otherData.getId());
136       setName(otherData.getName());
137       setFirstName(otherData.getFirstName());
138       setPhone(otherData.getPhone());
139       setFax(otherData.getFax());
140       setCreationDate(otherData.getCreationDate());
141
142    }
143
144    public test.interfaces.CustomerPK getPrimaryKey() {
145      test.interfaces.CustomerPK pk = new test.interfaces.CustomerPK(this.getId());
146      return pk;
147    }
148
149    public float getCredit()
150    {
151       return this.credit;
152    }
153    public void setCredit( float credit )
154    {
155       this.credit = credit;
156    }
157
158    public java.lang.String JavaDoc[][] getArray()
159    {
160       return this.array;
161    }
162    public void setArray( java.lang.String JavaDoc[][] array )
163    {
164       this.array = array;
165    }
166
167    public byte[] getImage()
168    {
169       return this.image;
170    }
171    public void setImage( byte[] image )
172    {
173       this.image = image;
174    }
175
176    public float getTax()
177    {
178       return this.tax;
179    }
180    public void setTax( float tax )
181    {
182       this.tax = tax;
183    }
184
185    public long getVersion()
186    {
187       return _version;
188    }
189
190    public void setVersion(long version)
191    {
192       this._version = version;
193    }
194
195    public String JavaDoc toString()
196    {
197       StringBuffer JavaDoc str = new StringBuffer JavaDoc("{");
198
199       str.append("credit=" + getCredit() + " " + "array=" + getArray() + " " + "image=" + getImage() + " " + "tax=" + getTax() + " " + "id=" + getId() + " " + "name=" + getName() + " " + "firstName=" + getFirstName() + " " + "phone=" + getPhone() + " " + "fax=" + getFax() + " " + "creationDate=" + getCreationDate());
200       str.append(",version=");
201       str.append(_version);
202       str.append('}');
203
204       return(str.toString());
205    }
206
207    public boolean equals( Object JavaDoc pOther )
208    {
209       if (!super.equals(pOther)) return false;
210       if( pOther instanceof CustomerData )
211       {
212          CustomerData lTest = (CustomerData) pOther;
213          boolean lEquals = true;
214
215          lEquals = lEquals && this.credit == lTest.credit;
216          if( this.array == null )
217          {
218             lEquals = lEquals && ( lTest.array == null );
219          }
220          else
221          {
222             lEquals = lEquals && this.array.equals( lTest.array );
223          }
224          lEquals = lEquals && this.image == lTest.image;
225          lEquals = lEquals && this.tax == lTest.tax;
226
227          return lEquals;
228       }
229       else
230       {
231          return false;
232       }
233    }
234
235    public int hashCode()
236    {
237       int result = super.hashCode();
238
239       result = 37*result + Float.floatToIntBits(credit);
240
241       result = 37*result + ((this.array != null) ? this.array.hashCode() : 0);
242
243       if (image != null) {
244         for (int i=0; i<image.length; i++)
245         {
246           long l = image[i];
247           result = 37*result + (int)(l^(l>>>32));
248         }
249       }
250
251       result = 37*result + Float.floatToIntBits(tax);
252
253       return result;
254    }
255
256 }
257
Popular Tags