1 package org.hibernate.test.stats; 3 4 7 public class Country { 8 private Integer id; 9 private String name; 10 11 public boolean equals(Object 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 getId() { 27 return id; 28 } 29 30 public void setId(Integer id) { 31 this.id = id; 32 } 33 34 public String getName() { 35 return name; 36 } 37 38 public void setName(String name) { 39 this.name = name; 40 } 41 } 42 | Popular Tags |