1 package org.hibernate.test.legacy; 2 3 import java.io.Serializable ; 4 5 8 public class MiddleKey implements Serializable { 9 private Inner sup; 10 private String one; 11 private String two; 12 13 public String getOne() { 14 return one; 15 } 16 17 public void setOne(String one) { 18 this.one = one; 19 } 20 21 public String getTwo() { 22 return two; 23 } 24 25 public void setTwo(String two) { 26 this.two = two; 27 } 28 29 public Inner getSup() { 30 return sup; 31 } 32 33 public void setSup(Inner sup) { 34 this.sup = sup; 35 } 36 37 public boolean equals(Object o) { 38 if (this == o) return true; 39 if (!(o instanceof MiddleKey)) return false; 40 41 final MiddleKey cidMasterID = (MiddleKey) o; 42 43 if (one != null ? !one.equals(cidMasterID.one) : cidMasterID.one != null) return false; 44 if (sup != null ? !sup.equals(cidMasterID.sup) : cidMasterID.sup != null) return false; 45 if (two != null ? !two.equals(cidMasterID.two) : cidMasterID.two != null) return false; 46 47 return true; 48 } 49 50 public int hashCode() { 51 int result; 52 result = (sup != null ? sup.hashCode() : 0); 53 result = 29 * result + (one != null ? one.hashCode() : 0); 54 result = 29 * result + (two != null ? two.hashCode() : 0); 55 return result; 56 } 57 } 58 | Popular Tags |