1 package org.hibernate.test.annotations.indexcoll; 3 4 import javax.persistence.Entity; 5 import javax.persistence.GeneratorType; 6 import javax.persistence.Id; 7 8 11 @Entity 12 public class Dress { 13 private Integer id; 14 15 @Id(generate = GeneratorType.AUTO) 16 public Integer getId() { 17 return id; 18 } 19 20 public void setId(Integer id) { 21 this.id = id; 22 } 23 24 public boolean equals(Object o) { 25 if ( this == o ) return true; 26 if ( !( o instanceof Dress ) ) return false; 27 28 final Dress dress = (Dress) o; 29 30 if ( !getId().equals( dress.getId() ) ) return false; 31 32 return true; 33 } 34 35 public int hashCode() { 36 return getId().hashCode(); 37 } 38 } 39 | Popular Tags |