KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jtests > beans > relation > tier > TierValue


1 package org.objectweb.jonas.jtests.beans.relation.tier;
2
3 /**
4  * Value object for TIERS.
5  */

6
7 public class TierValue extends java.lang.Object JavaDoc implements java.io.Serializable JavaDoc {
8
9     // define attributes
10
// define column 'numinttie' and update flag
11
private java.lang.Integer JavaDoc numinttie;
12
13     private boolean numinttieHasBeenSet = false;
14
15     // define column 'emailtie' and update flag
16
private java.lang.String JavaDoc emailtie;
17
18     private boolean emailtieHasBeenSet = false;
19     
20     // define primary key
21
private java.lang.Integer JavaDoc __pk;
22
23     // public constructor
24
public TierValue() {
25     }
26
27     // copy constructor ..
28
// TODO Cloneable is better than this !
29
public TierValue(TierValue otherValue) {
30         this.numinttie = otherValue.numinttie;
31         numinttieHasBeenSet = true;
32
33         this.emailtie = otherValue.emailtie;
34         emailtieHasBeenSet = true;
35
36
37         //TODO ? correct ?
38
// pk = otherValue.getPrimaryKey();
39
}
40
41     /*
42      * ALL FIELDS EXCEPT PRIMARY KEY
43      */

44     // getter-setter for emailtie
45
public java.lang.String JavaDoc getEmailtie() {
46         return this.emailtie;
47     }
48
49     public void setEmailtie(java.lang.String JavaDoc emailtie) {
50         this.emailtie = emailtie;
51         this.emailtieHasBeenSet = true;
52     }
53
54     public boolean emailtieHasBeenSet() {
55         return emailtieHasBeenSet;
56     }
57
58     /*
59      * PRIMARY KEY(s)
60      */

61     public java.lang.Integer JavaDoc getPrimaryKey() {
62         return __pk;
63     }
64
65     public java.lang.Integer JavaDoc getNuminttie() {
66         return this.numinttie;
67     }
68
69     public void setNuminttie(java.lang.Integer JavaDoc numinttie) {
70         this.numinttie = numinttie;
71         __pk = numinttie;
72         numinttieHasBeenSet = true;
73
74     }
75
76     public void setPrimaryKey(java.lang.Integer JavaDoc numinttie) {
77         setNuminttie(numinttie);
78     }
79
80     protected boolean numinttieHasBeenSet() {
81         return numinttieHasBeenSet;
82     }
83
84     /*
85      * Exposes getMethod of type getXXXXValue(), for each related table.
86      */

87     public java.lang.Integer JavaDoc getTiephyPK() {
88         return getNuminttie();
89     }
90
91     public java.lang.Integer JavaDoc getTiemorPK() {
92         return getNuminttie();
93     }
94
95     /*
96      * Generated toString() method, includes all fields and inherited fields
97      * from superclass toString
98      */

99     public String JavaDoc toString() {
100
101         StringBuffer JavaDoc str = new StringBuffer JavaDoc("{");
102
103         str.append("{[Tier], ");
104
105         str.append("numinttie" + getNuminttie() + ", "); // table isSimplePk ?
106
// true column isPk ?
107
// true
108
str.append("emailtie" + getEmailtie() + ", "); // table isSimplePk ?
109
// true column isPk ?
110
// false
111
str.append("{[Tier]");
112         return (str.toString());
113     }
114
115     /*
116      * ToXML builds an XML String of fields and inherited fields
117      */

118     public String JavaDoc toXML() {
119
120         StringBuffer JavaDoc str = new StringBuffer JavaDoc("{");
121         str.append("<docTier>");
122         str.append("<numinttie>" + getNuminttie() + "</numinttie>");
123         str.append("<emailtie>" + getEmailtie() + "</emailtie>");
124         str.append("</docTier>");
125         return (str.toString());
126     }
127
128     public boolean hasIdentity() {
129         return numinttieHasBeenSet();
130     }
131
132     public void validateData() throws Exception JavaDoc {
133         // mandatory columns
134
if (numinttie == null) throw new Exception JavaDoc("the field : 'numinttie' must not be null !");
135     }
136 }
Popular Tags