KickJava   Java API By Example, From Geeks To Geeks.

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


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

7
8 public class TiemorValue 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 'raisoctie' and update flag
17
private java.lang.String JavaDoc raisoctie;
18
19     private boolean raisoctieHasBeenSet = false;
20
21     // define primary key
22
private java.lang.Integer JavaDoc __pk;
23
24     // public constructor
25
public TiemorValue() {
26     }
27
28     // copy constructor ..
29
// TODO Cloneable is better than this !
30
public TiemorValue(TiemorValue otherValue) {
31         this.numinttie = otherValue.numinttie;
32         numinttieHasBeenSet = true;
33
34         this.raisoctie = otherValue.raisoctie;
35         raisoctieHasBeenSet = true;
36
37         //TODO ? correct ?
38
// pk = otherValue.getPrimaryKey();
39
}
40
41     /*
42      * ALL FIELDS EXCEPT PRIMARY KEY
43      */

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

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

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

96     public String JavaDoc toString() {
97
98         StringBuffer JavaDoc str = new StringBuffer JavaDoc("{");
99
100         str.append("{[Tiemor], ");
101
102         str.append("numinttie" + getNuminttie() + ", "); // table isSimplePk ?
103
// true column isPk ?
104
// true
105
str.append("raisoctie" + getRaisoctie() + ", "); // table isSimplePk ?
106
// true column isPk ?
107
// false
108

109         str.append("{[Tiemor]");
110         return (str.toString());
111     }
112
113     /*
114      * ToXML builds an XML String of fields and inherited fields
115      */

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