1 package org.hibernate.test.legacy; 2 3 import java.io.Serializable ; 4 5 8 public class OuterKey implements Serializable { 9 private Middle master; 10 private String detailId; 11 12 public Middle getMaster() { 13 return master; 14 } 15 16 public void setMaster(Middle master) { 17 this.master = master; 18 } 19 20 public String getDetailId() { 21 return detailId; 22 } 23 24 public void setDetailId(String detailId) { 25 this.detailId = detailId; 26 } 27 28 public boolean equals(Object o) { 29 if (this == o) return true; 30 if (!(o instanceof OuterKey)) return false; 31 32 final OuterKey cidDetailID = (OuterKey) o; 33 34 if (detailId != null ? !detailId.equals(cidDetailID.detailId) : cidDetailID.detailId != null) return false; 35 if (master != null ? !master.equals(cidDetailID.master) : cidDetailID.master != null) return false; 36 37 return true; 38 } 39 40 public int hashCode() { 41 int result; 42 result = (master != null ? master.hashCode() : 0); 43 result = 29 * result + (detailId != null ? detailId.hashCode() : 0); 44 return result; 45 } 46 } 47 | Popular Tags |