KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

44     // getter-setter for nomusatie
45
public java.lang.String JavaDoc getNomusatie() {
46         return this.nomusatie;
47     }
48
49     public void setNomusatie(java.lang.String JavaDoc nomusatie) {
50         this.nomusatie = nomusatie;
51         this.nomusatieHasBeenSet = true;
52     }
53
54     public boolean nomusatieHasBeenSet() {
55         return nomusatieHasBeenSet;
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 getTierPK() {
88         return getNuminttie();
89     }
90
91     /*
92      * Generated toString() method, includes all fields and inherited fields
93      * from superclass toString
94      */

95     public String JavaDoc toString() {
96
97         StringBuffer JavaDoc str = new StringBuffer JavaDoc("{");
98
99         str.append("{[Tiephy], ");
100
101         str.append("numinttie" + getNuminttie() + ", "); // table isSimplePk ?
102
// true column isPk ?
103
// true
104
str.append("nomusatie" + getNomusatie() + ", "); // table isSimplePk ?
105
// true column isPk ?
106
// false
107
str.append("{[Tiephy]");
108         return (str.toString());
109     }
110
111     /*
112      * ToXML builds an XML String of fields and inherited fields
113      */

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