1 package org.hibernate.test.annotations.cid; 3 4 import javax.persistence.AccessType; 5 import javax.persistence.EmbeddedId; 6 import javax.persistence.Entity; 7 8 12 @Entity(access=AccessType.FIELD) 13 public class Parent { 14 @EmbeddedId 15 public ParentPk id; 16 17 public boolean equals(Object o) { 18 if (this == o) return true; 19 if (!(o instanceof Parent)) return false; 20 21 final Parent parent = (Parent) o; 22 23 if (!id.equals(parent.id)) return false; 24 25 return true; 26 } 27 28 public int hashCode() { 29 return id.hashCode(); 30 } 31 } 32 | Popular Tags |