1 package org.hibernate.test.annotations.manytomany; 3 4 import java.io.Serializable ; 5 6 9 public class CatPk implements Serializable { 10 private String name; 11 private String thoroughbred; 12 13 public String getThoroughbred() { 14 return thoroughbred; 15 } 16 17 public void setThoroughbred(String thoroughbred) { 18 this.thoroughbred = thoroughbred; 19 } 20 21 public String getName() { 22 return name; 23 } 24 25 public void setName(String name) { 26 this.name = name; 27 } 28 29 public boolean equals(Object o) { 30 if (this == o) return true; 31 if (!(o instanceof CatPk)) return false; 32 33 final CatPk catPk = (CatPk) o; 34 35 if (!name.equals(catPk.name)) return false; 36 if (!thoroughbred.equals(catPk.thoroughbred)) return false; 37 38 return true; 39 } 40 41 public int hashCode() { 42 int result; 43 result = name.hashCode(); 44 result = 29 * result + thoroughbred.hashCode(); 45 return result; 46 } 47 } 48 | Popular Tags |