1 package com.atlassian.user.impl.hibernate;
2
3 import com.atlassian.user.impl.DefaultUser;
4 import com.atlassian.user.Group;
5
6 import java.util.Iterator;
7 import java.util.Set;
8 import java.util.HashSet;
9
10
11
12
13
14
15
16
17
18
19
20
21
22 public class DefaultHibernateUser extends DefaultUser
23 {
24 private transient Set<Group> groups = new HashSet<Group>();
25
26 private long id;
27
28 public DefaultHibernateUser(){}
29
30 public DefaultHibernateUser(String name)
31 {
32 super(name);
33 }
34
35
36
37
38
39
40 public Set<Group> getGroups()
41 {
42 return groups;
43 }
44
45 public void setGroups(Set<Group> groups)
46 {
47 this.groups = groups;
48 }
49
50 public long getId()
51 {
52 return id;
53 }
54
55 public void setId(long id)
56 {
57 this.id = id;
58 }
59
60 public boolean equals(Object o)
61 {
62 if (this == o) return true;
63 if (!(o instanceof DefaultHibernateUser)) return false;
64 if (!super.equals(o)) return false;
65
66 final DefaultHibernateUser defaultHibernateUser = (DefaultHibernateUser) o;
67
68 return id == defaultHibernateUser.id;
69 }
70
71 public String toString() {
72 StringBuffer ret = new StringBuffer("id:").append(id).
73 append(" name:").append(name).
74 append(" fullName:").append(fullName).
75 append(" email:").append(email).
76 append(" created:").append(created);
77 return ret.toString();
78 }
79
80 public int hashCode()
81 {
82 int result = super.hashCode();
83 result = 29 * result + (int) (id ^ (id >>> 32));
84 return result;
85 }
86 }