KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > annotations > manytomany > CatPk


1 //$Id: CatPk.java,v 1.1 2005/05/12 13:33:33 epbernard Exp $
2
package org.hibernate.test.annotations.manytomany;
3
4 import java.io.Serializable JavaDoc;
5
6 /**
7  * @author Emmanuel Bernard
8  */

9 public class CatPk implements Serializable JavaDoc {
10     private String JavaDoc name;
11     private String JavaDoc thoroughbred;
12
13     public String JavaDoc getThoroughbred() {
14         return thoroughbred;
15     }
16
17     public void setThoroughbred(String JavaDoc thoroughbred) {
18         this.thoroughbred = thoroughbred;
19     }
20
21     public String JavaDoc getName() {
22         return name;
23     }
24
25     public void setName(String JavaDoc name) {
26         this.name = name;
27     }
28
29     public boolean equals(Object JavaDoc 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