1 4 package test.ejb.cmr; 5 6 19 public class EmployeeValue 20 extends java.lang.Object 21 implements java.io.Serializable , java.lang.Cloneable 22 { 23 24 private java.lang.Integer id; 25 private boolean idHasBeenSet = false; 26 27 private java.lang.String name; 28 private boolean nameHasBeenSet = false; 29 private test.ejb.cmr.EmployeeAddressValue HomeAddress; 30 private boolean HomeAddressHasBeenSet = false; 31 private test.ejb.cmr.EmployeeAddressValue WorkAddress; 32 private boolean WorkAddressHasBeenSet = false; 33 34 private java.lang.Integer primaryKey; 35 36 public EmployeeValue() 37 { 38 } 39 40 public EmployeeValue( java.lang.Integer id,java.lang.String name ) 41 { 42 setId(id); 43 setName(name); 44 primaryKey = this.getId(); 45 } 46 47 50 public EmployeeValue( EmployeeValue otherValue ) 51 { 52 this.id = otherValue.id; 53 idHasBeenSet = true; 54 this.name = otherValue.name; 55 nameHasBeenSet = true; 56 this.HomeAddress = otherValue.HomeAddress; 57 HomeAddressHasBeenSet = true; 58 this.WorkAddress = otherValue.WorkAddress; 59 WorkAddressHasBeenSet = true; 60 61 primaryKey = this.getId(); 62 } 63 64 public java.lang.Integer getPrimaryKey() 65 { 66 return primaryKey; 67 } 68 69 public void setPrimaryKey( java.lang.Integer primaryKey) 70 { 71 this.primaryKey = primaryKey; 74 setId( primaryKey ); 75 } 76 77 public java.lang.Integer getId() 78 { 79 return this.id; 80 } 81 82 public void setId( java.lang.Integer id ) 83 { 84 this.id = id; 85 idHasBeenSet = true; 86 87 primaryKey = id; 88 } 89 90 public boolean idHasBeenSet(){ 91 return idHasBeenSet; 92 } 93 public java.lang.String getName() 94 { 95 return this.name; 96 } 97 98 public void setName( java.lang.String name ) 99 { 100 this.name = name; 101 nameHasBeenSet = true; 102 103 } 104 105 public boolean nameHasBeenSet(){ 106 return nameHasBeenSet; 107 } 108 109 public test.ejb.cmr.EmployeeAddressValue getHomeAddress() 110 { 111 return this.HomeAddress; 112 } 113 public void setHomeAddress( test.ejb.cmr.EmployeeAddressValue HomeAddress ) 114 { 115 this.HomeAddress = HomeAddress; 116 HomeAddressHasBeenSet = true; 117 } 118 public boolean homeAddressHasBeenSet() 119 { 120 return HomeAddressHasBeenSet; 121 } 122 public test.ejb.cmr.EmployeeAddressValue getWorkAddress() 123 { 124 return this.WorkAddress; 125 } 126 public void setWorkAddress( test.ejb.cmr.EmployeeAddressValue WorkAddress ) 127 { 128 this.WorkAddress = WorkAddress; 129 WorkAddressHasBeenSet = true; 130 } 131 public boolean workAddressHasBeenSet() 132 { 133 return WorkAddressHasBeenSet; 134 } 135 136 public String toString() 137 { 138 StringBuffer str = new StringBuffer ("{"); 139 140 str.append("id=" + getId() + " " + "name=" + getName()); 141 str.append('}'); 142 143 return(str.toString()); 144 } 145 146 151 protected boolean hasIdentity() 152 { 153 return idHasBeenSet; 154 } 155 156 160 public boolean isIdentical(Object other) 161 { 162 if (other instanceof EmployeeValue) 163 { 164 EmployeeValue that = (EmployeeValue) other; 165 boolean lEquals = true; 166 if( this.id == null ) 167 { 168 lEquals = lEquals && ( that.id == null ); 169 } 170 else 171 { 172 lEquals = lEquals && this.id.equals( that.id ); 173 } 174 if( this.name == null ) 175 { 176 lEquals = lEquals && ( that.name == null ); 177 } 178 else 179 { 180 lEquals = lEquals && this.name.equals( that.name ); 181 } 182 if( this.HomeAddress == null ) 183 { 184 lEquals = lEquals && ( that.HomeAddress == null ); 185 } 186 else 187 { 188 lEquals = lEquals && this.HomeAddress.equals( that.HomeAddress ); 189 } 190 if( this.WorkAddress == null ) 191 { 192 lEquals = lEquals && ( that.WorkAddress == null ); 193 } 194 else 195 { 196 lEquals = lEquals && this.WorkAddress.equals( that.WorkAddress ); 197 } 198 199 return lEquals; 200 } 201 else 202 { 203 return false; 204 } 205 } 206 207 public boolean equals(Object other) { 208 209 if (!(other instanceof EmployeeValue)) { 211 return false; 212 } 213 214 return equals((EmployeeValue) other); 215 } 216 217 222 public boolean equals(EmployeeValue that) { 223 224 if (this == that) { 226 return true; 227 } 228 if(null == that) { 230 return false; 231 } 232 233 if(this.id != that.id) { 234 235 if( this.id == null || that.id == null ) { 236 return false; 237 } 238 239 if(!this.id.equals(that.id)) { 240 return false; 241 } 242 243 } 244 245 if(this.name != that.name) { 246 247 if( this.name == null || that.name == null ) { 248 return false; 249 } 250 251 if(!this.name.equals(that.name)) { 252 return false; 253 } 254 255 } 256 257 if(this.HomeAddress != that.HomeAddress) { 258 if((this.HomeAddress == null) || (that.HomeAddress == null)) { 259 return false; 260 } 261 if(!this.HomeAddress.equals(that.HomeAddress)) { 262 return false; 263 } 264 } 265 266 if(this.WorkAddress != that.WorkAddress) { 267 if((this.WorkAddress == null) || (that.WorkAddress == null)) { 268 return false; 269 } 270 if(!this.WorkAddress.equals(that.WorkAddress)) { 271 return false; 272 } 273 } 274 275 return true; 276 277 } 278 279 public Object clone() throws java.lang.CloneNotSupportedException { 280 EmployeeValue other = (EmployeeValue) super.clone(); 281 282 return other; 283 } 284 285 public ReadOnlyEmployeeValue getReadOnlyEmployeeValue() { 286 return new ReadOnlyEmployeeValue(); 287 } 288 289 public int hashCode(){ 290 int result = 17; 291 result = 37*result + ((this.id != null) ? this.id.hashCode() : 0); 292 293 result = 37*result + ((this.name != null) ? this.name.hashCode() : 0); 294 295 result = 37*result + ((this.HomeAddress != null) ? this.HomeAddress.hashCode() : 0); 296 result = 37*result + ((this.WorkAddress != null) ? this.WorkAddress.hashCode() : 0); 297 298 return result; 299 } 300 301 308 private static java.util.Collection wrapCollection(java.util.Collection input) { 309 return java.util.Collections.synchronizedCollection(input); 310 } 311 318 private static java.util.Set wrapCollection(java.util.Set input) { 319 return java.util.Collections.synchronizedSet(input); 320 } 321 327 private static java.util.Collection wrapReadOnly(java.util.Collection input) { 328 return java.util.Collections.unmodifiableCollection(input); 329 } 330 336 private static java.util.Set wrapReadOnly(java.util.Set input) { 337 return java.util.Collections.unmodifiableSet(input); 338 } 339 340 private final class ReadOnlyEmployeeValue 341 implements java.lang.Cloneable , java.io.Serializable 342 { 343 private EmployeeValue underlying() { 344 return EmployeeValue.this; 345 } 346 347 public java.lang.Integer getId() { 348 return underlying().id; 349 } 350 351 public java.lang.String getName() { 352 return underlying().name; 353 } 354 355 public test.ejb.cmr.EmployeeAddressValue getHomeAddress() 356 { 357 return underlying().HomeAddress; 358 } 359 public test.ejb.cmr.EmployeeAddressValue getWorkAddress() 360 { 361 return underlying().WorkAddress; 362 } 363 364 public int hashCode() { 365 return 101 * underlying().hashCode(); 366 } 367 368 public boolean equals(Object o) { 369 if(o instanceof ReadOnlyEmployeeValue) { 370 return this.equals((ReadOnlyEmployeeValue) o); 371 } 372 return false; 373 } 374 375 public boolean equals(ReadOnlyEmployeeValue that) { 376 if(null == that) { 377 return false; 378 } 379 380 return this.underlying().equals(that.underlying()); 381 } 382 383 } 384 385 } 386 | Popular Tags |