KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > orphan > User


1 /*
2  * User.java
3  *
4  * Created on May 3, 2005, 9:42 AM
5  */

6
7 package org.hibernate.test.orphan;
8
9 import java.util.HashSet JavaDoc;
10 import java.util.Set JavaDoc;
11
12
13 /**
14  * @author Kevin
15  */

16 public class User {
17
18     private Integer JavaDoc id;
19     private String JavaDoc userid;
20     private Set JavaDoc mail = new HashSet JavaDoc();
21
22     public User() {
23     }
24
25     public User(String JavaDoc userid) {
26         this.userid = userid;
27     }
28
29     public Integer JavaDoc getId() {
30         return id;
31     }
32
33     protected void setId(Integer JavaDoc id) {
34         this.id = id;
35     }
36
37     public String JavaDoc getUserid() {
38         return userid;
39     }
40
41     public void setUserid(String JavaDoc userid) {
42         this.userid = userid;
43     }
44
45     public Set JavaDoc getMail() {
46         return mail;
47     }
48
49     private void setMail(Set JavaDoc mail) {
50         this.mail = mail;
51     }
52
53     public Mail addMail(String JavaDoc alias) {
54         Mail mail = new Mail( alias, this );
55         getMail().add( mail );
56         return mail;
57     }
58
59     public void removeMail(Mail mail) {
60         getMail().remove( mail );
61     }
62 }
63
Popular Tags