Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/hibernate/test/manytomany/ordered/Group.java


1   package org.hibernate.test.manytomany.ordered;
2   
3   import java.io.Serializable;
4   import java.util.List;
5   import java.util.ArrayList;
6   
7   public class Group implements Serializable {
8   
9     private Long id;
10    private String org;
11    private String name;
12    private String description;
13  
14    private List users = new ArrayList();
15  
16    public Group() {
17    }
18  
19    public Group(String name, String org) {
20      this.org = org;
21      this.name = name;
22    }
23  
24    public Long getId() {
25      return id;
26    }
27  
28    public void setId(Long id) {
29      this.id = id;
30    }
31  
32    public String getName() {
33      return name;
34    }
35  
36    public void setName(String name) {
37      this.name = name;
38    }
39  
40    public String getOrg() {
41      return org;
42    }
43  
44    public void setOrg(String org) {
45      this.org = org;
46    }
47  
48    public List getUsers() {
49      return users;
50    }
51  
52    public void setUsers(List users) {
53      this.users = users;
54    }
55  
56    public String getDescription() {
57      return description;
58    }
59  
60    public void setDescription(String description) {
61      this.description = description;
62    }
63  
64    public void addUser(User user) {
65      if ( user.getGroups().add( this ) ) {
66        getUsers().add( user );
67      }
68    }
69  }