KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > interfaces > CustomerNormalValue


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

4 package test.interfaces;
5
6 /**
7  * Value object for Customer.
8  *
9  * Notice, this object is used to represent the state of an
10  * Customer object. This value object
11  * Is not connected to the database in any way, it is just a normal object used
12  * as a container for data from an EJB.
13  *
14  * @xdoclet-generated at 16-04-05
15  * @copyright The XDoclet Team
16  * @author XDoclet
17  * @version 1.2.3
18  */

19 public class CustomerNormalValue
20    extends java.lang.Object JavaDoc
21    implements java.io.Serializable JavaDoc, java.lang.Cloneable JavaDoc
22 {
23
24    private float credit;
25    private boolean creditHasBeenSet = false;
26
27    private java.lang.String JavaDoc[][] array;
28    private boolean arrayHasBeenSet = false;
29
30    private byte[] image;
31    private boolean imageHasBeenSet = false;
32
33    private float tax;
34    private boolean taxHasBeenSet = false;
35
36    private java.lang.String JavaDoc id;
37    private boolean idHasBeenSet = false;
38
39    private java.lang.String JavaDoc name;
40    private boolean nameHasBeenSet = false;
41
42    private java.lang.String JavaDoc firstName;
43    private boolean firstNameHasBeenSet = false;
44    private java.util.Collection JavaDoc AccountViews = wrapCollection(new java.util.ArrayList JavaDoc() );
45
46    private java.util.Collection JavaDoc ShippingAddressValues = wrapCollection(new java.util.ArrayList JavaDoc() );
47
48    private test.interfaces.CustomerPK primaryKey;
49
50    private int _version = 0;
51
52    public CustomerNormalValue()
53    {
54       primaryKey = new test.interfaces.CustomerPK();
55    }
56
57    public CustomerNormalValue( 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 )
58    {
59        setCredit(credit);
60        setArray(array);
61        setImage(image);
62        setTax(tax);
63        setId(id);
64        setName(name);
65        setFirstName(firstName);
66        primaryKey = new test.interfaces.CustomerPK(this.getId());
67    }
68
69    /**
70     * @deprecated use {@link #clone}
71     */

72    public CustomerNormalValue( CustomerNormalValue otherValue )
73    {
74       this.credit = otherValue.credit;
75       creditHasBeenSet = true;
76       this.array = otherValue.array;
77       arrayHasBeenSet = true;
78       this.image = otherValue.image;
79       imageHasBeenSet = true;
80       this.tax = otherValue.tax;
81       taxHasBeenSet = true;
82       this.id = otherValue.id;
83       idHasBeenSet = true;
84       this.name = otherValue.name;
85       nameHasBeenSet = true;
86       this.firstName = otherValue.firstName;
87       firstNameHasBeenSet = true;
88       this.AccountViews.addAll(otherValue.AccountViews);
89       this.ShippingAddressValues.addAll(otherValue.ShippingAddressValues);
90
91       primaryKey = new test.interfaces.CustomerPK(this.getId());
92    }
93
94    public test.interfaces.CustomerPK getPrimaryKey()
95    {
96       return primaryKey;
97    }
98
99    public void setPrimaryKey( test.interfaces.CustomerPK primaryKey)
100    {
101       // it's also nice to update PK object - just in case
102
// somebody would ask for it later...
103
this.primaryKey = primaryKey;
104       setId( primaryKey.id );
105    }
106
107    public float getCredit()
108    {
109       return this.credit;
110    }
111
112    public void setCredit( float credit )
113    {
114       this.credit = credit;
115       creditHasBeenSet = true;
116
117    }
118
119    public boolean creditHasBeenSet(){
120       return creditHasBeenSet;
121    }
122    public java.lang.String JavaDoc[][] getArray()
123    {
124       return this.array;
125    }
126
127    private void setArray( java.lang.String JavaDoc[][] array )
128    {
129       this.array = array;
130       arrayHasBeenSet = true;
131
132    }
133
134    public byte[] getImage()
135    {
136       return this.image;
137    }
138
139    private void setImage( byte[] image )
140    {
141       this.image = image;
142       imageHasBeenSet = true;
143
144    }
145
146    public float getTax()
147    {
148       return this.tax;
149    }
150
151    private void setTax( float tax )
152    {
153       this.tax = tax;
154       taxHasBeenSet = true;
155
156    }
157
158    public java.lang.String JavaDoc getId()
159    {
160       return this.id;
161    }
162
163    public void setId( java.lang.String JavaDoc id )
164    {
165       this.id = id;
166       idHasBeenSet = true;
167
168       primaryKey.setId(id);
169    }
170
171    public boolean idHasBeenSet(){
172       return idHasBeenSet;
173    }
174    public java.lang.String JavaDoc getName()
175    {
176       return this.name;
177    }
178
179    public void setName( java.lang.String JavaDoc name )
180    {
181       this.name = name;
182       nameHasBeenSet = true;
183
184    }
185
186    public boolean nameHasBeenSet(){
187       return nameHasBeenSet;
188    }
189    public java.lang.String JavaDoc getFirstName()
190    {
191       return this.firstName;
192    }
193
194    public void setFirstName( java.lang.String JavaDoc firstName )
195    {
196       this.firstName = firstName;
197       firstNameHasBeenSet = true;
198
199    }
200
201    public boolean firstNameHasBeenSet(){
202       return firstNameHasBeenSet;
203    }
204
205    protected java.util.Collection JavaDoc addedAccountViews = wrapCollection(new java.util.ArrayList JavaDoc());
206    protected java.util.Collection JavaDoc onceAddedAccountViews = wrapCollection(new java.util.ArrayList JavaDoc());
207    protected java.util.Collection JavaDoc removedAccountViews = wrapCollection(new java.util.ArrayList JavaDoc());
208    protected java.util.Collection JavaDoc updatedAccountViews = wrapCollection(new java.util.ArrayList JavaDoc());
209
210    /**
211     * Important: This method returns an unmodifiable collection.
212     */

213    public java.util.Collection JavaDoc getAddedAccountViews() { return wrapReadOnly(addedAccountViews); }
214
215    /**
216     * Important: This method returns an unmodifiable collection.
217     */

218     public java.util.Collection JavaDoc getOnceAddedAccountViews() { return wrapReadOnly(onceAddedAccountViews); }
219    /**
220     * Important: This method returns an unmodifiable collection.
221     */

222     public java.util.Collection JavaDoc getRemovedAccountViews() { return wrapReadOnly(removedAccountViews); }
223    /**
224     * Important: This method returns an unmodifiable collection.
225     */

226     public java.util.Collection JavaDoc getUpdatedAccountViews() { return wrapReadOnly(updatedAccountViews); }
227    /**
228     * Important: This method returns an unmodifiable collection.
229     */

230     public java.util.Collection JavaDoc getAccountViewCollection() { return wrapReadOnly(AccountViews); }
231
232    /**
233     * This will set the contents of the underlying collection to the contents of the
234     * given collection. This means that any unmodifiable collections given out will
235     * also change. The collections are guaranteed to be consistent, but not correct.
236     * In this case, it is possible to see a collection in the process of changing,
237     * it might appear to be empty for an instant, but it will behave correctly.
238     * Also, the update will be atomic with respect to the input collection
239     * if the input collection is a synchronized collection.
240     *
241     * This method has been deprecated, as it strains the imagination to conceive of
242     * a reason for outsiders to modify these collections, which are really for our
243     * own internal bookkeeping.
244     *
245     * @deprecated
246     */

247    public void setAddedAccountViews(java.util.Collection JavaDoc addedAccountViews)
248    {
249       //This operation is atomic if the input collection is synchronized.
250
java.util.List JavaDoc tempList = java.util.Arrays.asList(addedAccountViews.toArray());
251       this.addedAccountViews.clear();
252       this.addedAccountViews.addAll(tempList);
253    }
254
255    /**
256     * This will set the contents of the underlying collection to the contents of the
257     * given collection. This means that any unmodifiable collections given out will
258     * also change. The collections are guaranteed to be consistent, but not correct.
259     * In this case, it is possible to see a collection in the process of changing,
260     * it might appear to be empty for an instant, but it will behave correctly.
261     * Also, the update will be atomic with respect to the input collection
262     * if the input collection is a synchronized collection.
263     *
264     * This method has been deprecated, as it strains the imagination to conceive of
265     * a reason for outsiders to modify these collections, which are really for our
266     * own internal bookkeeping.
267     *
268     * @deprecated
269     */

270    public void setOnceAddedAccountViews(java.util.Collection JavaDoc onceAddedAccountViews)
271    {
272       //This operation is atomic if the input collection is synchronized.
273
java.util.List JavaDoc tempList = java.util.Arrays.asList(onceAddedAccountViews.toArray());
274       this.onceAddedAccountViews.clear();
275       this.onceAddedAccountViews.addAll(tempList);
276     }
277
278    /**
279     * This will set the contents of the underlying collection to the contents of the
280     * given collection. This means that any unmodifiable collections given out will
281     * also change. The collections are guaranteed to be consistent, but not correct.
282     * In this case, it is possible to see a collection in the process of changing,
283     * it might appear to be empty for an instant, but it will behave correctly.
284     * Also, the update will be atomic with respect to the input collection
285     * if the input collection is a synchronized collection.
286     *
287     * This method has been deprecated, as it strains the imagination to conceive of
288     * a reason for outsiders to modify these collections, which are really for our
289     * own internal bookkeeping.
290     *
291     * @deprecated
292     */

293    public void setRemovedAccountViews(java.util.Collection JavaDoc removedAccountViews)
294    {
295       //This operation is atomic if the input collection is synchronized.
296
java.util.List JavaDoc tempList = java.util.Arrays.asList(removedAccountViews.toArray());
297       this.removedAccountViews.clear();
298       this.removedAccountViews.addAll(tempList);
299    }
300
301    /**
302     * This will set the contents of the underlying collection to the contents of the
303     * given collection. This means that any unmodifiable collections given out will
304     * also change. The collections are guaranteed to be consistent, but not correct.
305     * In this case, it is possible to see a collection in the process of changing,
306     * it might appear to be empty for an instant, but it will behave correctly.
307     * Also, the update will be atomic with respect to the input collection
308     * if the input collection is a synchronized collection.
309     *
310     * This method has been deprecated, as it strains the imagination to conceive of
311     * a reason for outsiders to modify these collections, which are really for our
312     * own internal bookkeeping.
313     *
314     * @deprecated
315     */

316    public void setUpdatedAccountViews(java.util.Collection JavaDoc updatedAccountViews)
317    {
318       //This operation is atomic if the input collection is synchronized.
319
java.util.List JavaDoc tempList = java.util.Arrays.asList(updatedAccountViews.toArray());
320       this.updatedAccountViews.clear();
321       this.updatedAccountViews.addAll(tempList);
322    }
323
324    /**
325     * This method fetches the contents of the underlying collection as an Array.
326     * It is a relatively expensive operation, so use the collections if you can.
327     *
328     * This operation is atomic and threadsafe unless the synchronization type is "none".
329     *
330     * This operation is deprecated, as it is fairly expensive and should be discouraged.
331     *
332     * @deprecated
333     */

334    public test.interfaces.AccountValue[] getAccountViews()
335    {
336     return (test.interfaces.AccountValue[])this.AccountViews.toArray(new test.interfaces.AccountValue[AccountViews.size()]);
337    }
338
339    /**
340     * This method sets the contents of the given attribute to the contents of the
341     * given array.
342     *
343     * This operation is atomic and threadsafe unless the synchronization type is "none".
344     *
345     * This operation is deprecated, as it is fairly expensive and should be discouraged.
346     *
347     * @deprecated
348     */

349    public void setAccountViews(test.interfaces.AccountValue[] AccountViews)
350    {
351       this.AccountViews.clear();
352       for (int i=0; i < AccountViews.length; i++) {
353         this.AccountViews.add(AccountViews[i]);
354       }
355    }
356
357    public void clearAccountViews()
358    {
359       this.AccountViews.clear();
360    }
361
362    /**
363     * When we're adding an aggregate object, we check if it was previously removed, and
364     * if it was, we check if it was ever added. If the user adds an object, then removes
365     * it then adds it again, we keep the object in the added collection. If the user
366     * just removes an object (thas wasn't added in this session, just existed before) then
367     * adds it again, we assume the user is updating a current existing object, so it will
368     * end in the updated collection.
369     */

370    public void addAccountView(test.interfaces.AccountValue added)
371    {
372       this.AccountViews.add(added);
373
374       if (this.removedAccountViews.contains(added))
375       {
376         this.removedAccountViews.remove(added);
377         if (this.onceAddedAccountViews.contains(added))
378         {
379           if (! this.addedAccountViews.contains(added))
380             this.addedAccountViews.add(added);
381         }
382         else if (! this.updatedAccountViews.contains(added))
383         {
384             this.updatedAccountViews.add(added);
385         }
386       }
387       else
388       {
389         if (! this.onceAddedAccountViews.contains(added))
390           this.onceAddedAccountViews.add(added);
391         if (! this.addedAccountViews.contains(added))
392           this.addedAccountViews.add(added);
393       }
394    }
395
396    /**
397     * If we're removing an object that was previously added, we just remove it from
398     * the added collection and don't add it in the remove collection. The user has
399     * just given up on creating the object. If we're removing a previously updated
400     * object, we remove it from the updated collection, since it will be removed
401     * anyway.
402     */

403    public void removeAccountView(test.interfaces.AccountValue removed)
404    {
405       this.AccountViews.remove(removed);
406
407       if (this.addedAccountViews.contains(removed))
408         this.addedAccountViews.remove(removed);
409       else if (! this.removedAccountViews.contains(removed))
410         this.removedAccountViews.add(removed);
411
412       if (this.updatedAccountViews.contains(removed))
413         this.updatedAccountViews.remove(removed);
414    }
415
416    public void updateAccountView(test.interfaces.AccountValue updated)
417    {
418       if ( !this.updatedAccountViews.contains(updated) && !this.addedAccountViews.contains(updated))
419              this.updatedAccountViews.add(updated);
420
421       if (this.removedAccountViews.contains(updated))
422          this.removedAccountViews.remove(updated);
423    }
424
425    public void cleanAccountView(){
426     this.addedAccountViews.clear();
427         this.onceAddedAccountViews.clear();
428     this.removedAccountViews.clear();
429     this.updatedAccountViews.clear();
430    }
431
432    public void copyAccountViewsFrom(test.interfaces.CustomerNormalValue from)
433    {
434         this.AccountViews.clear();
435         this.AccountViews.addAll(from.AccountViews);
436    }
437    protected java.util.Collection JavaDoc addedShippingAddressValues = wrapCollection(new java.util.ArrayList JavaDoc());
438    protected java.util.Collection JavaDoc onceAddedShippingAddressValues = wrapCollection(new java.util.ArrayList JavaDoc());
439    protected java.util.Collection JavaDoc removedShippingAddressValues = wrapCollection(new java.util.ArrayList JavaDoc());
440    protected java.util.Collection JavaDoc updatedShippingAddressValues = wrapCollection(new java.util.ArrayList JavaDoc());
441
442    /**
443     * Important: This method returns an unmodifiable collection.
444     */

445    public java.util.Collection JavaDoc getAddedShippingAddressValues() { return wrapReadOnly(addedShippingAddressValues); }
446
447    /**
448     * Important: This method returns an unmodifiable collection.
449     */

450     public java.util.Collection JavaDoc getOnceAddedShippingAddressValues() { return wrapReadOnly(onceAddedShippingAddressValues); }
451    /**
452     * Important: This method returns an unmodifiable collection.
453     */

454     public java.util.Collection JavaDoc getRemovedShippingAddressValues() { return wrapReadOnly(removedShippingAddressValues); }
455    /**
456     * Important: This method returns an unmodifiable collection.
457     */

458     public java.util.Collection JavaDoc getUpdatedShippingAddressValues() { return wrapReadOnly(updatedShippingAddressValues); }
459    /**
460     * Important: This method returns an unmodifiable collection.
461     */

462     public java.util.Collection JavaDoc getShippingAddressValueCollection() { return wrapReadOnly(ShippingAddressValues); }
463
464    /**
465     * This will set the contents of the underlying collection to the contents of the
466     * given collection. This means that any unmodifiable collections given out will
467     * also change. The collections are guaranteed to be consistent, but not correct.
468     * In this case, it is possible to see a collection in the process of changing,
469     * it might appear to be empty for an instant, but it will behave correctly.
470     * Also, the update will be atomic with respect to the input collection
471     * if the input collection is a synchronized collection.
472     *
473     * This method has been deprecated, as it strains the imagination to conceive of
474     * a reason for outsiders to modify these collections, which are really for our
475     * own internal bookkeeping.
476     *
477     * @deprecated
478     */

479    public void setAddedShippingAddressValues(java.util.Collection JavaDoc addedShippingAddressValues)
480    {
481       //This operation is atomic if the input collection is synchronized.
482
java.util.List JavaDoc tempList = java.util.Arrays.asList(addedShippingAddressValues.toArray());
483       this.addedShippingAddressValues.clear();
484       this.addedShippingAddressValues.addAll(tempList);
485    }
486
487    /**
488     * This will set the contents of the underlying collection to the contents of the
489     * given collection. This means that any unmodifiable collections given out will
490     * also change. The collections are guaranteed to be consistent, but not correct.
491     * In this case, it is possible to see a collection in the process of changing,
492     * it might appear to be empty for an instant, but it will behave correctly.
493     * Also, the update will be atomic with respect to the input collection
494     * if the input collection is a synchronized collection.
495     *
496     * This method has been deprecated, as it strains the imagination to conceive of
497     * a reason for outsiders to modify these collections, which are really for our
498     * own internal bookkeeping.
499     *
500     * @deprecated
501     */

502    public void setOnceAddedShippingAddressValues(java.util.Collection JavaDoc onceAddedShippingAddressValues)
503    {
504       //This operation is atomic if the input collection is synchronized.
505
java.util.List JavaDoc tempList = java.util.Arrays.asList(onceAddedShippingAddressValues.toArray());
506       this.onceAddedShippingAddressValues.clear();
507       this.onceAddedShippingAddressValues.addAll(tempList);
508     }
509
510    /**
511     * This will set the contents of the underlying collection to the contents of the
512     * given collection. This means that any unmodifiable collections given out will
513     * also change. The collections are guaranteed to be consistent, but not correct.
514     * In this case, it is possible to see a collection in the process of changing,
515     * it might appear to be empty for an instant, but it will behave correctly.
516     * Also, the update will be atomic with respect to the input collection
517     * if the input collection is a synchronized collection.
518     *
519     * This method has been deprecated, as it strains the imagination to conceive of
520     * a reason for outsiders to modify these collections, which are really for our
521     * own internal bookkeeping.
522     *
523     * @deprecated
524     */

525    public void setRemovedShippingAddressValues(java.util.Collection JavaDoc removedShippingAddressValues)
526    {
527       //This operation is atomic if the input collection is synchronized.
528
java.util.List JavaDoc tempList = java.util.Arrays.asList(removedShippingAddressValues.toArray());
529       this.removedShippingAddressValues.clear();
530       this.removedShippingAddressValues.addAll(tempList);
531    }
532
533    /**
534     * This will set the contents of the underlying collection to the contents of the
535     * given collection. This means that any unmodifiable collections given out will
536     * also change. The collections are guaranteed to be consistent, but not correct.
537     * In this case, it is possible to see a collection in the process of changing,
538     * it might appear to be empty for an instant, but it will behave correctly.
539     * Also, the update will be atomic with respect to the input collection
540     * if the input collection is a synchronized collection.
541     *
542     * This method has been deprecated, as it strains the imagination to conceive of
543     * a reason for outsiders to modify these collections, which are really for our
544     * own internal bookkeeping.
545     *
546     * @deprecated
547     */

548    public void setUpdatedShippingAddressValues(java.util.Collection JavaDoc updatedShippingAddressValues)
549    {
550       //This operation is atomic if the input collection is synchronized.
551
java.util.List JavaDoc tempList = java.util.Arrays.asList(updatedShippingAddressValues.toArray());
552       this.updatedShippingAddressValues.clear();
553       this.updatedShippingAddressValues.addAll(tempList);
554    }
555
556    /**
557     * This method fetches the contents of the underlying collection as an Array.
558     * It is a relatively expensive operation, so use the collections if you can.
559     *
560     * This operation is atomic and threadsafe unless the synchronization type is "none".
561     *
562     * This operation is deprecated, as it is fairly expensive and should be discouraged.
563     *
564     * @deprecated
565     */

566    public test.interfaces.AddressValue[] getShippingAddressValues()
567    {
568     return (test.interfaces.AddressValue[])this.ShippingAddressValues.toArray(new test.interfaces.AddressValue[ShippingAddressValues.size()]);
569    }
570
571    /**
572     * This method sets the contents of the given attribute to the contents of the
573     * given array.
574     *
575     * This operation is atomic and threadsafe unless the synchronization type is "none".
576     *
577     * This operation is deprecated, as it is fairly expensive and should be discouraged.
578     *
579     * @deprecated
580     */

581    public void setShippingAddressValues(test.interfaces.AddressValue[] ShippingAddressValues)
582    {
583       this.ShippingAddressValues.clear();
584       for (int i=0; i < ShippingAddressValues.length; i++) {
585         this.ShippingAddressValues.add(ShippingAddressValues[i]);
586       }
587    }
588
589    public void clearShippingAddressValues()
590    {
591       this.ShippingAddressValues.clear();
592    }
593
594    /**
595     * When we're adding an aggregate object, we check if it was previously removed, and
596     * if it was, we check if it was ever added. If the user adds an object, then removes
597     * it then adds it again, we keep the object in the added collection. If the user
598     * just removes an object (thas wasn't added in this session, just existed before) then
599     * adds it again, we assume the user is updating a current existing object, so it will
600     * end in the updated collection.
601     */

602    public void addShippingAddressValue(test.interfaces.AddressValue added)
603    {
604       this.ShippingAddressValues.add(added);
605
606       if (this.removedShippingAddressValues.contains(added))
607       {
608         this.removedShippingAddressValues.remove(added);
609         if (this.onceAddedShippingAddressValues.contains(added))
610         {
611           if (! this.addedShippingAddressValues.contains(added))
612             this.addedShippingAddressValues.add(added);
613         }
614         else if (! this.updatedShippingAddressValues.contains(added))
615         {
616             this.updatedShippingAddressValues.add(added);
617         }
618       }
619       else
620       {
621         if (! this.onceAddedShippingAddressValues.contains(added))
622           this.onceAddedShippingAddressValues.add(added);
623         if (! this.addedShippingAddressValues.contains(added))
624           this.addedShippingAddressValues.add(added);
625       }
626    }
627
628    /**
629     * If we're removing an object that was previously added, we just remove it from
630     * the added collection and don't add it in the remove collection. The user has
631     * just given up on creating the object. If we're removing a previously updated
632     * object, we remove it from the updated collection, since it will be removed
633     * anyway.
634     */

635    public void removeShippingAddressValue(test.interfaces.AddressValue removed)
636    {
637       this.ShippingAddressValues.remove(removed);
638
639       if (this.addedShippingAddressValues.contains(removed))
640         this.addedShippingAddressValues.remove(removed);
641       else if (! this.removedShippingAddressValues.contains(removed))
642         this.removedShippingAddressValues.add(removed);
643
644       if (this.updatedShippingAddressValues.contains(removed))
645         this.updatedShippingAddressValues.remove(removed);
646    }
647
648    public void updateShippingAddressValue(test.interfaces.AddressValue updated)
649    {
650       if ( !this.updatedShippingAddressValues.contains(updated) && !this.addedShippingAddressValues.contains(updated))
651              this.updatedShippingAddressValues.add(updated);
652
653       if (this.removedShippingAddressValues.contains(updated))
654          this.removedShippingAddressValues.remove(updated);
655    }
656
657    public void cleanShippingAddressValue(){
658     this.addedShippingAddressValues.clear();
659         this.onceAddedShippingAddressValues.clear();
660     this.removedShippingAddressValues.clear();
661     this.updatedShippingAddressValues.clear();
662    }
663
664    public void copyShippingAddressValuesFrom(test.interfaces.CustomerNormalValue from)
665    {
666         this.ShippingAddressValues.clear();
667         this.ShippingAddressValues.addAll(from.ShippingAddressValues);
668    }
669
670    public int getVersion()
671    {
672       return _version;
673    }
674    public void setVersion(int version)
675    {
676       this._version = version;
677    }
678
679    public String JavaDoc toString()
680    {
681       StringBuffer JavaDoc str = new StringBuffer JavaDoc("{");
682
683       str.append("credit=" + getCredit() + " " + "array=" + getArray() + " " + "image=" + getImage() + " " + "tax=" + getTax() + " " + "id=" + getId() + " " + "name=" + getName() + " " + "firstName=" + getFirstName());
684       str.append(",version=");
685       str.append(_version);
686       str.append('}');
687
688       return(str.toString());
689    }
690
691    /**
692     * A Value Object has an identity if the attributes making its Primary Key have all been set. An object without identity is never equal to any other object.
693     *
694     * @return true if this instance has an identity.
695     */

696    protected boolean hasIdentity()
697    {
698       boolean ret = true;
699       ret = ret && idHasBeenSet;
700       return ret;
701    }
702
703    /**
704     *
705     * @deprecated use {@link #equals}
706     */

707    public boolean isIdentical(Object JavaDoc other)
708    {
709           if (other instanceof CustomerNormalValue)
710           {
711                  CustomerNormalValue that = (CustomerNormalValue) other;
712                  boolean lEquals = true;
713                  lEquals = lEquals && this.credit == that.credit;
714                  if( this.array == null )
715                  {
716                         lEquals = lEquals && ( that.array == null );
717                  }
718                  else
719                  {
720                         lEquals = lEquals && this.array.equals( that.array );
721                  }
722                  lEquals = lEquals && this.image == that.image;
723                  lEquals = lEquals && this.tax == that.tax;
724                  if( this.name == null )
725                  {
726                         lEquals = lEquals && ( that.name == null );
727                  }
728                  else
729                  {
730                         lEquals = lEquals && this.name.equals( that.name );
731                  }
732                  if( this.firstName == null )
733                  {
734                         lEquals = lEquals && ( that.firstName == null );
735                  }
736                  else
737                  {
738                         lEquals = lEquals && this.firstName.equals( that.firstName );
739                  }
740                  if( this.getAccountViews() == null )
741                  {
742                         lEquals = lEquals && ( that.getAccountViews() == null );
743                  }
744                  else
745                  {
746                         lEquals = lEquals && java.util.Arrays.equals(this.getAccountViews() , that.getAccountViews()) ;
747                  }
748                  if( this.getShippingAddressValues() == null )
749                  {
750                         lEquals = lEquals && ( that.getShippingAddressValues() == null );
751                  }
752                  else
753                  {
754                         lEquals = lEquals && java.util.Arrays.equals(this.getShippingAddressValues() , that.getShippingAddressValues()) ;
755                  }
756
757                  return lEquals;
758           }
759           else
760           {
761                  return false;
762           }
763    }
764
765     public boolean equals(Object JavaDoc other) {
766
767         //If it's not the correct type, clearly it isn't equal to this.
768
if (!(other instanceof CustomerNormalValue)) {
769             return false;
770         }
771
772         return equals((CustomerNormalValue) other);
773     }
774
775     /**
776      * This class is not using strict ordering. This means that the object is not Comparable, and
777      * each check for equality will test all members for equality. We do not check collections for
778      * equality however, so you would be wise to not use this if you have collection typed EJB References.
779      */

780     public boolean equals(CustomerNormalValue that) {
781
782         //try to get lucky.
783
if (this == that) {
784             return true;
785         }
786         //this clearly isn't null.
787
if(null == that) {
788             return false;
789         }
790
791         if(this.credit != that.credit) {
792             return false;
793         }
794
795         if(this.array != that.array) {
796
797             if( this.array == null || that.array == null ) {
798                 return false;
799             }
800
801             if(!this.array.equals(that.array)) {
802                 return false;
803             }
804
805         }
806
807         if(!java.util.Arrays.equals(this.image, that.image)) {
808             return false;
809         }
810
811         if(this.tax != that.tax) {
812             return false;
813         }
814
815         if(this.id != that.id) {
816
817             if( this.id == null || that.id == null ) {
818                 return false;
819             }
820
821             if(!this.id.equals(that.id)) {
822                 return false;
823             }
824
825         }
826
827         if(this.name != that.name) {
828
829             if( this.name == null || that.name == null ) {
830                 return false;
831             }
832
833             if(!this.name.equals(that.name)) {
834                 return false;
835             }
836
837         }
838
839         if(this.firstName != that.firstName) {
840
841             if( this.firstName == null || that.firstName == null ) {
842                 return false;
843             }
844
845             if(!this.firstName.equals(that.firstName)) {
846                 return false;
847             }
848
849         }
850
851          // AccountView is an aggregate type. We won't compare the contents of collections (for performance reasons), so note
852
//that these will not be considered when calculating equality or hash codes. You would be wise to use strict ordering if possible, as that makes
853
//for more tractable behavior.
854
// ShippingAddressValue is an aggregate type. We won't compare the contents of collections (for performance reasons), so note
855
//that these will not be considered when calculating equality or hash codes. You would be wise to use strict ordering if possible, as that makes
856
//for more tractable behavior.
857

858         return true;
859
860     }
861
862     public Object JavaDoc clone() throws java.lang.CloneNotSupportedException JavaDoc {
863         CustomerNormalValue other = (CustomerNormalValue) super.clone();
864
865         {
866         //Anonymous block to protect from namespace collisions.
867
java.util.Collection JavaDoc tempData;
868         tempData = wrapCollection(new java.util.ArrayList JavaDoc());
869         tempData.addAll(this.AccountViews);
870         this.AccountViews = tempData;
871         tempData = wrapCollection(new java.util.ArrayList JavaDoc());
872         tempData.addAll(this.addedAccountViews);
873         this.addedAccountViews = tempData;
874         tempData = wrapCollection(new java.util.ArrayList JavaDoc());
875         tempData.addAll(this.onceAddedAccountViews);
876         this.onceAddedAccountViews = tempData;
877         tempData = wrapCollection(new java.util.ArrayList JavaDoc());
878         tempData.addAll(this.removedAccountViews);
879         this.removedAccountViews = tempData;
880         tempData = wrapCollection(new java.util.ArrayList JavaDoc());
881         tempData.addAll(this.updatedAccountViews);
882         this.updatedAccountViews = tempData;
883         }
884         {
885         //Anonymous block to protect from namespace collisions.
886
java.util.Collection JavaDoc tempData;
887         tempData = wrapCollection(new java.util.ArrayList JavaDoc());
888         tempData.addAll(this.ShippingAddressValues);
889         this.ShippingAddressValues = tempData;
890         tempData = wrapCollection(new java.util.ArrayList JavaDoc());
891         tempData.addAll(this.addedShippingAddressValues);
892         this.addedShippingAddressValues = tempData;
893         tempData = wrapCollection(new java.util.ArrayList JavaDoc());
894         tempData.addAll(this.onceAddedShippingAddressValues);
895         this.onceAddedShippingAddressValues = tempData;
896         tempData = wrapCollection(new java.util.ArrayList JavaDoc());
897         tempData.addAll(this.removedShippingAddressValues);
898         this.removedShippingAddressValues = tempData;
899         tempData = wrapCollection(new java.util.ArrayList JavaDoc());
900         tempData.addAll(this.updatedShippingAddressValues);
901         this.updatedShippingAddressValues = tempData;
902         }
903
904         return other;
905     }
906
907     public ReadOnlyCustomerNormalValue getReadOnlyCustomerNormalValue() {
908         return new ReadOnlyCustomerNormalValue();
909     }
910
911     public int hashCode(){
912       int result = 17;
913       result = 37*result + Float.floatToIntBits(credit);
914
915       result = 37*result + ((this.array != null) ? this.array.hashCode() : 0);
916
917       if (image != null) {
918         for (int i=0; i<image.length; i++)
919         {
920           long l = image[i];
921           result = 37*result + (int)(l^(l>>>32));
922         }
923       }
924
925       result = 37*result + Float.floatToIntBits(tax);
926
927       result = 37*result + ((this.id != null) ? this.id.hashCode() : 0);
928
929       result = 37*result + ((this.name != null) ? this.name.hashCode() : 0);
930
931       result = 37*result + ((this.firstName != null) ? this.firstName.hashCode() : 0);
932
933       // AccountView is an aggregate type. We won't compare the contents of collections (for performance reasons), so note
934
//that these will not be considered when calculating equality or hash codes. You would be wise to use strict ordering if possible, as that makes
935
//for more tractable behavior.
936
// ShippingAddressValue is an aggregate type. We won't compare the contents of collections (for performance reasons), so note
937
//that these will not be considered when calculating equality or hash codes. You would be wise to use strict ordering if possible, as that makes
938
//for more tractable behavior.
939

940       return result;
941     }
942
943     /**
944      * Covariant function so the compiler can choose the proper one at compile time,
945      * eliminates the need for XDoclet to really understand compiletime typing.
946      *
947      * Read only collections need to be synchronized. Once we start giving out handles
948      * to these collections, they'll be used in other threads sooner or later.
949      */

950     private static java.util.Collection JavaDoc wrapCollection(java.util.Collection JavaDoc input) {
951         return java.util.Collections.synchronizedCollection(input);
952     }
953     /**
954      * Covariant function so the compiler can choose the proper one at compile time,
955      * eliminates the need for XDoclet to really understand compiletime typing.
956      *
957      * Read only collections need to be synchronized. Once we start giving out handles
958      * to these collections, they'll be used in other threads sooner or later.
959      */

960     private static java.util.Set JavaDoc wrapCollection(java.util.Set JavaDoc input) {
961         return java.util.Collections.synchronizedSet(input);
962     }
963     /**
964      * Covariant function. This is used in covariant form so that the compiler
965      * can do some of our conditional branches for us. If I made these functions
966      * have different names, then XDoclet would have to choose between them based on
967      * compiletime types, that wouldn't be easy.
968      */

969     private static java.util.Collection JavaDoc wrapReadOnly(java.util.Collection JavaDoc input) {
970         return java.util.Collections.unmodifiableCollection(input);
971     }
972     /**
973      * Covariant function. This is used in covariant form so that the compiler
974      * can do some of our conditional branches for us. If I made these functions
975      * have different names, then XDoclet would have to choose between them based on
976      * compiletime types, that wouldn't be easy.
977      */

978     private static java.util.Set JavaDoc wrapReadOnly(java.util.Set JavaDoc input) {
979         return java.util.Collections.unmodifiableSet(input);
980     }
981
982     private final class ReadOnlyCustomerNormalValue
983     implements java.lang.Cloneable JavaDoc, java.io.Serializable JavaDoc
984     {
985         private CustomerNormalValue underlying() {
986             return CustomerNormalValue.this;
987         }
988
989        public float getCredit() {
990               return underlying().credit;
991        }
992
993        public java.lang.String JavaDoc[][] getArray() {
994               return underlying().array;
995        }
996
997        public byte[] getImage() {
998               return underlying().image;
999        }
1000
1001       public float getTax() {
1002              return underlying().tax;
1003       }
1004
1005       public java.lang.String JavaDoc getId() {
1006              return underlying().id;
1007       }
1008
1009       public java.lang.String JavaDoc getName() {
1010              return underlying().name;
1011       }
1012
1013       public java.lang.String JavaDoc getFirstName() {
1014              return underlying().firstName;
1015       }
1016
1017       public java.util.Collection JavaDoc getAddedAccountViews() {
1018            return underlying().getAddedAccountViews();
1019       }
1020       public java.util.Collection JavaDoc getOnceAddedAccountViews() {
1021            return underlying().getOnceAddedAccountViews();
1022       }
1023       public java.util.Collection JavaDoc getRemovedAccountViews() {
1024            return underlying().getRemovedAccountViews();
1025       }
1026       public java.util.Collection JavaDoc getUpdatedAccountViews() {
1027            return underlying().getUpdatedAccountViews();
1028       }
1029       public java.util.Collection JavaDoc getAccountViewCollection() {
1030            return underlying().getAccountViewCollection();
1031       }
1032       public java.util.Collection JavaDoc getAddedShippingAddressValues() {
1033            return underlying().getAddedShippingAddressValues();
1034       }
1035       public java.util.Collection JavaDoc getOnceAddedShippingAddressValues() {
1036            return underlying().getOnceAddedShippingAddressValues();
1037       }
1038       public java.util.Collection JavaDoc getRemovedShippingAddressValues() {
1039            return underlying().getRemovedShippingAddressValues();
1040       }
1041       public java.util.Collection JavaDoc getUpdatedShippingAddressValues() {
1042            return underlying().getUpdatedShippingAddressValues();
1043       }
1044       public java.util.Collection JavaDoc getShippingAddressValueCollection() {
1045            return underlying().getShippingAddressValueCollection();
1046       }
1047
1048        public int hashCode() {
1049            return 101 * underlying().hashCode();
1050        }
1051
1052        public boolean equals(Object JavaDoc o) {
1053            if(o instanceof ReadOnlyCustomerNormalValue) {
1054                return this.equals((ReadOnlyCustomerNormalValue) o);
1055            }
1056            return false;
1057        }
1058
1059        public boolean equals(ReadOnlyCustomerNormalValue that) {
1060            if(null == that) {
1061                return false;
1062            }
1063
1064            return this.underlying().equals(that.underlying());
1065        }
1066
1067    }
1068
1069}
1070
Popular Tags