1 package org.hibernate.test.legacy; 3 4 import java.io.Serializable ; 5 import java.util.Date ; 6 7 public class FooComponent implements Serializable { 8 9 int count; 10 String name; 11 Date [] importantDates; 12 FooComponent subcomponent; 13 Fee fee = new Fee(); 14 GlarchProxy glarch; 15 private FooProxy parent; 16 private Baz baz; 17 18 public boolean equals(Object that) { 19 FooComponent fc = (FooComponent) that; 20 return count==fc.count; 21 } 22 23 public int hashCode() { 24 return count; 25 } 26 27 public String toString() { 28 String result = "FooComponent: " + name + "=" + count; 29 result+="; dates=["; 30 if ( importantDates!=null) { 31 for ( int i=0; i<importantDates.length; i++ ) { 32 result+=(i==0 ?"":", ") + importantDates[i]; 33 } 34 } 35 result+="]"; 36 if ( subcomponent!=null ) { 37 result+= " (" + subcomponent + ")"; 38 } 39 return result; 40 } 41 42 public FooComponent() {} 43 44 FooComponent(String name, int count, Date [] dates, FooComponent subcomponent) { 45 this.name = name; 46 this.count = count; 47 this.importantDates = dates; 48 this.subcomponent = subcomponent; 49 } 50 51 FooComponent(String name, int count, Date [] dates, FooComponent subcomponent, Fee fee) { 52 this.name = name; 53 this.count = count; 54 this.importantDates = dates; 55 this.subcomponent = subcomponent; 56 this.fee = fee; 57 } 58 59 public int getCount() { 60 return count; 61 } 62 public void setCount(int count) { 63 this.count = count; 64 } 65 66 public String getName() { 67 return name; 68 } 69 public void setName(String name) { 70 this.name = name; 71 } 72 73 public Date [] getImportantDates() { 74 return importantDates; 75 } 76 public void setImportantDates(Date [] importantDates) { 77 this.importantDates = importantDates; 78 } 79 80 public FooComponent getSubcomponent() { 81 return subcomponent; 82 } 83 public void setSubcomponent(FooComponent subcomponent) { 84 this.subcomponent = subcomponent; 85 } 86 87 private String getNull() { 88 return null; 89 } 90 private void setNull(String str) throws Exception { 91 if (str!=null) throw new Exception ("null component property"); 92 } 93 public Fee getFee() { 94 return fee; 95 } 96 97 public void setFee(Fee fee) { 98 this.fee = fee; 99 } 100 101 public GlarchProxy getGlarch() { 102 return glarch; 103 } 104 105 public void setGlarch(GlarchProxy glarch) { 106 this.glarch = glarch; 107 } 108 109 public FooProxy getParent() { 110 return parent; 111 } 112 113 public void setParent(FooProxy parent) { 114 this.parent = parent; 116 } 117 118 public Baz getBaz() { 119 return baz; 120 } 121 122 public void setBaz(Baz baz) { 123 this.baz = baz; 124 } 125 126 } 127 128 129 130 131 132 133 134 | Popular Tags |