1 package org.hibernate.test.usercollection; 3 4 7 public class Email { 8 9 private Long id; 10 private String address; 11 12 Email() {} 13 14 public String getAddress() { 15 return address; 16 } 17 public void setAddress(String type) { 18 this.address = type; 19 } 20 public Email(String type) { 21 this.address = type; 22 } 23 public boolean equals(Object that) { 24 if ( !(that instanceof Email) ) return false; 25 Email p = (Email) that; 26 return this.address.equals(p.address); 27 } 28 public int hashCode() { 29 return address.hashCode(); 30 } 31 32 public Long getId() { 33 return id; 34 } 35 36 private void setId(Long id) { 37 this.id = id; 38 } 39 } 40 | Popular Tags |