1 package org.hibernate.test.annotations.join; 3 4 import javax.persistence.AccessType; 5 import javax.persistence.Embeddable; 6 import java.io.Serializable ; 7 8 11 @Embeddable(access=AccessType.FIELD) 12 public class DogPk implements Serializable { 13 public String name; 14 public String ownerName; 15 16 public boolean equals(Object o) { 17 if (this == o) return true; 18 if (!(o instanceof DogPk)) return false; 19 20 final DogPk dogPk = (DogPk) o; 21 22 if (!name.equals(dogPk.name)) return false; 23 if (!ownerName.equals(dogPk.ownerName)) return false; 24 25 return true; 26 } 27 28 public int hashCode() { 29 int result; 30 result = name.hashCode(); 31 result = 29 * result + ownerName.hashCode(); 32 return result; 33 } 34 } 35 | Popular Tags |