001: package org.objectweb.jonas.jtests.beans.relation.tier;
002:
003: /**
004: * Value object for TIEPHY.
005: */
006:
007: public class TiephyValue extends java.lang.Object implements
008: java.io.Serializable {
009:
010: // define attributes
011: // define column 'numinttie' and update flag
012: private java.lang.Integer numinttie;
013:
014: private boolean numinttieHasBeenSet = false;
015:
016: // define column 'nomusatie' and update flag
017: private java.lang.String nomusatie;
018:
019: private boolean nomusatieHasBeenSet = false;
020:
021: // define primary key
022: private java.lang.Integer __pk;
023:
024: // public constructor
025: public TiephyValue() {
026: }
027:
028: // copy constructor ..
029: // TODO Cloneable is better than this !
030: public TiephyValue(TiephyValue otherValue) {
031: this .numinttie = otherValue.numinttie;
032: numinttieHasBeenSet = true;
033:
034: this .nomusatie = otherValue.nomusatie;
035: nomusatieHasBeenSet = true;
036:
037: //TODO ? correct ?
038: // pk = otherValue.getPrimaryKey();
039: }
040:
041: /*
042: * ALL FIELDS EXCEPT PRIMARY KEY
043: */
044: // getter-setter for nomusatie
045: public java.lang.String getNomusatie() {
046: return this .nomusatie;
047: }
048:
049: public void setNomusatie(java.lang.String nomusatie) {
050: this .nomusatie = nomusatie;
051: this .nomusatieHasBeenSet = true;
052: }
053:
054: public boolean nomusatieHasBeenSet() {
055: return nomusatieHasBeenSet;
056: }
057:
058: /*
059: * PRIMARY KEY(s)
060: */
061: public java.lang.Integer getPrimaryKey() {
062: return __pk;
063: }
064:
065: public java.lang.Integer getNuminttie() {
066: return this .numinttie;
067: }
068:
069: public void setNuminttie(java.lang.Integer numinttie) {
070: this .numinttie = numinttie;
071: __pk = numinttie;
072: numinttieHasBeenSet = true;
073:
074: }
075:
076: public void setPrimaryKey(java.lang.Integer numinttie) {
077: setNuminttie(numinttie);
078: }
079:
080: protected boolean numinttieHasBeenSet() {
081: return numinttieHasBeenSet;
082: }
083:
084: /*
085: * Exposes getMethod of type getXXXXValue(), for each related table.
086: */
087: public java.lang.Integer getTierPK() {
088: return getNuminttie();
089: }
090:
091: /*
092: * Generated toString() method, includes all fields and inherited fields
093: * from superclass toString
094: */
095: public String toString() {
096:
097: StringBuffer str = new StringBuffer("{");
098:
099: 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 toXML() {
115:
116: StringBuffer str = new StringBuffer("{");
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 {
130: // mandatory columns
131: if (numinttie == null)
132: throw new Exception(
133: "the field : 'numinttie' must not be null !");
134: if (nomusatie == null)
135: throw new Exception(
136: "the field : 'nomusatie' must not be null !");
137: }
138: }
|