KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > exception > Group


1 // $Id: Group.java,v 1.1 2004/11/11 20:56:43 steveebersole Exp $
2
package org.hibernate.test.exception;
3
4 import java.util.Set JavaDoc;
5
6 /**
7  * Implementation of Group.
8  *
9  * @author Steve Ebersole
10  */

11 public class Group {
12     private Long JavaDoc id;
13     private String JavaDoc name;
14     private Set JavaDoc members;
15
16     public Long JavaDoc getId() {
17         return id;
18     }
19
20     public void setId(Long JavaDoc id) {
21         this.id = id;
22     }
23
24     public String JavaDoc getName() {
25         return name;
26     }
27
28     public void setName(String JavaDoc name) {
29         this.name = name;
30     }
31
32     public Set JavaDoc getMembers() {
33         return members;
34     }
35
36     public void setMembers(Set JavaDoc members) {
37         this.members = members;
38     }
39
40     public void addMember(User member) {
41         if (member == null) {
42             throw new IllegalArgumentException JavaDoc("Member to add cannot be null");
43         }
44
45         this.members.add(member);
46         member.getMemberships().add(this);
47     }
48 }
49
Popular Tags