KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > stats > Country


1 //$Id: Country.java,v 1.1 2005/05/09 16:09:37 epbernard Exp $
2
package org.hibernate.test.stats;
3
4 /**
5  * @author Emmanuel Bernard
6  */

7 public class Country {
8     private Integer JavaDoc id;
9     private String JavaDoc name;
10
11     public boolean equals(Object JavaDoc o) {
12         if (this == o) return true;
13         if (!(o instanceof Country)) return false;
14
15         final Country country = (Country) o;
16
17         if (!name.equals(country.name)) return false;
18
19         return true;
20     }
21
22     public int hashCode() {
23         return name.hashCode();
24     }
25
26     public Integer JavaDoc getId() {
27         return id;
28     }
29
30     public void setId(Integer JavaDoc id) {
31         this.id = id;
32     }
33
34     public String JavaDoc getName() {
35         return name;
36     }
37
38     public void setName(String JavaDoc name) {
39         this.name = name;
40     }
41 }
42
Popular Tags