1 package org.hibernate.test.legacy; 3 4 import java.util.ArrayList ; 5 import java.util.Collection ; 6 import java.util.List ; 7 import java.util.Map ; 8 import java.util.Set ; 9 10 public class Container { 11 12 public static final class ContainerInnerClass { 13 private Simple simple; 14 private String name; 15 private One one; 16 private Many many; 17 private int count; 18 19 public void setSimple(Simple simple) { 20 this.simple = simple; 21 } 22 23 public Simple getSimple() { 24 return simple; 25 } 26 30 public String getName() { 31 return name; 32 } 33 34 38 public void setName(String name) { 39 this.name = name; 40 } 41 42 public String toString() { 43 return name + " = " 44 + (simple==null ? "nil" : Integer.toString( simple.getCount() ) ) 45 + "/" + ( one==null ? "nil" : one.getKey().toString() ) 46 + "/" + ( many==null ? "nil" : many.getKey().toString() ); 47 } 48 49 50 54 public One getOne() { 55 return one; 56 } 57 58 62 public void setOne(One one) { 63 this.one = one; 64 } 65 66 70 public Many getMany() { 71 return many; 72 } 73 74 78 public void setMany(Many many) { 79 this.many = many; 80 } 81 82 86 public int getCount() { 87 return count; 88 } 89 90 94 public void setCount(int count) { 95 this.count = count; 96 } 97 98 public int hashCode() { 99 return count + name.hashCode(); 100 } 101 102 public boolean equals(Object other) { 103 ContainerInnerClass cic = (ContainerInnerClass) other; 104 return cic.name.equals(name) 105 && cic.count==count 106 && cic.one.getKey().equals(one.getKey()) 107 && cic.many.getKey().equals(many.getKey()) 108 && cic.simple.getCount()==simple.getCount(); 109 } 110 111 } 112 113 private List oneToMany; 114 private List manyToMany; 115 private List components; 116 private Set composites; 117 private Collection cascades; 118 private long id; 119 private Collection bag; 120 private Collection lazyBag = new ArrayList (); 121 private Map ternaryMap; 122 private Set ternarySet; 123 124 127 public Container() { 128 super(); 129 } 130 131 135 public List getComponents() { 136 return components; 137 } 138 139 143 public List getManyToMany() { 144 return manyToMany; 145 } 146 147 151 public List getOneToMany() { 152 return oneToMany; 153 } 154 155 159 public void setComponents(List components) { 160 this.components = components; 161 } 162 163 167 public void setManyToMany(List manyToMany) { 168 this.manyToMany = manyToMany; 169 } 170 171 175 public void setOneToMany(List oneToMany) { 176 this.oneToMany = oneToMany; 177 } 178 179 183 public long getId() { 184 return id; 185 } 186 187 191 public void setId(long id) { 192 this.id = id; 193 } 194 195 199 public Set getComposites() { 200 return composites; 201 } 202 203 207 public void setComposites(Set composites) { 208 this.composites = composites; 209 } 210 211 215 public Collection getBag() { 216 return bag; 217 } 218 219 223 public void setBag(Collection bag) { 224 this.bag = bag; 225 } 226 227 231 public Map getTernaryMap() { 232 return ternaryMap; 233 } 234 235 239 public void setTernaryMap(Map ternary) { 240 this.ternaryMap = ternary; 241 } 242 243 public static final class Ternary { 244 private String name; 245 private Foo foo; 246 private Glarch glarch; 247 251 public Foo getFoo() { 252 return foo; 253 } 254 255 259 public Glarch getGlarch() { 260 return glarch; 261 } 262 263 267 public String getName() { 268 return name; 269 } 270 271 275 public void setFoo(Foo foo) { 276 this.foo = foo; 277 } 278 279 283 public void setGlarch(Glarch glarch) { 284 this.glarch = glarch; 285 } 286 287 291 public void setName(String name) { 292 this.name = name; 293 } 294 295 } 296 297 301 public Set getTernarySet() { 302 return ternarySet; 303 } 304 305 309 public void setTernarySet(Set ternarySet) { 310 this.ternarySet = ternarySet; 311 } 312 313 317 public Collection getLazyBag() { 318 return lazyBag; 319 } 320 321 325 public void setLazyBag(Collection lazyBag) { 326 this.lazyBag = lazyBag; 327 } 328 329 333 public Collection getCascades() { 334 return cascades; 335 } 336 337 341 public void setCascades(Collection cascades) { 342 this.cascades = cascades; 343 } 344 345 } 346 347 348 349 350 351 352 | Popular Tags |