KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > annotations > indexcoll > Dress


1 //$Id: Dress.java,v 1.1 2005/05/12 13:33:33 epbernard Exp $
2
package org.hibernate.test.annotations.indexcoll;
3
4 import javax.persistence.Entity;
5 import javax.persistence.GeneratorType;
6 import javax.persistence.Id;
7
8 /**
9  * @author Emmanuel Bernard
10  */

11 @Entity
12 public class Dress {
13     private Integer JavaDoc id;
14
15     @Id(generate = GeneratorType.AUTO)
16     public Integer JavaDoc getId() {
17         return id;
18     }
19
20     public void setId(Integer JavaDoc id) {
21         this.id = id;
22     }
23
24     public boolean equals(Object JavaDoc 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