001: package org.objectweb.jonas.jtests.beans.relation.tier;
002:
003: /**
004: * Value object for TIERS.
005: */
006:
007: public class TierValue 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 'emailtie' and update flag
017: private java.lang.String emailtie;
018:
019: private boolean emailtieHasBeenSet = false;
020:
021: // define primary key
022: private java.lang.Integer __pk;
023:
024: // public constructor
025: public TierValue() {
026: }
027:
028: // copy constructor ..
029: // TODO Cloneable is better than this !
030: public TierValue(TierValue otherValue) {
031: this .numinttie = otherValue.numinttie;
032: numinttieHasBeenSet = true;
033:
034: this .emailtie = otherValue.emailtie;
035: emailtieHasBeenSet = true;
036:
037: //TODO ? correct ?
038: // pk = otherValue.getPrimaryKey();
039: }
040:
041: /*
042: * ALL FIELDS EXCEPT PRIMARY KEY
043: */
044: // getter-setter for emailtie
045: public java.lang.String getEmailtie() {
046: return this .emailtie;
047: }
048:
049: public void setEmailtie(java.lang.String emailtie) {
050: this .emailtie = emailtie;
051: this .emailtieHasBeenSet = true;
052: }
053:
054: public boolean emailtieHasBeenSet() {
055: return emailtieHasBeenSet;
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 getTiephyPK() {
088: return getNuminttie();
089: }
090:
091: public java.lang.Integer getTiemorPK() {
092: return getNuminttie();
093: }
094:
095: /*
096: * Generated toString() method, includes all fields and inherited fields
097: * from superclass toString
098: */
099: public String toString() {
100:
101: StringBuffer str = new StringBuffer("{");
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 toXML() {
119:
120: StringBuffer str = new StringBuffer("{");
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 {
133: // mandatory columns
134: if (numinttie == null)
135: throw new Exception(
136: "the field : 'numinttie' must not be null !");
137: }
138: }
|