Subversion Repositories WebE

Rev

Rev 21 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21 Rev 33
Line 1... Line 1...
1
package ch.ffhs.webE.domain;
1
package ch.ffhs.webE.domain;
2
2
3
// Generated 19.12.2010 14:46:08 by Hibernate Tools 3.4.0.Beta1
3
// Generated 19.12.2010 14:46:08 by Hibernate Tools 3.4.0.Beta1
4
4
-
 
5
import static javax.persistence.GenerationType.IDENTITY;
-
 
6
5
import java.util.HashSet;
7
import java.util.HashSet;
6
import java.util.Set;
8
import java.util.Set;
-
 
9
7
import javax.persistence.Column;
10
import javax.persistence.Column;
8
import javax.persistence.Entity;
11
import javax.persistence.Entity;
9
import javax.persistence.FetchType;
12
import javax.persistence.FetchType;
10
import javax.persistence.GeneratedValue;
13
import javax.persistence.GeneratedValue;
11
import static javax.persistence.GenerationType.IDENTITY;
-
 
12
import javax.persistence.Id;
14
import javax.persistence.Id;
13
import javax.persistence.OneToMany;
15
import javax.persistence.OneToMany;
14
import javax.persistence.Table;
16
import javax.persistence.Table;
15
import javax.persistence.UniqueConstraint;
17
import javax.persistence.UniqueConstraint;
16
18
17
/**
19
/**
18
 * User generated by hbm2java
20
 * User generated by hbm2java
19
 */
21
 */
20
@Entity
22
@Entity
21
@Table(name = "user", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = "username"))
23
@Table(name = "user", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = "username"))
22
public class User implements java.io.Serializable {
24
public class User implements java.io.Serializable
-
 
25
{
-
 
26
  /**
-
 
27
   * Version ID for serialization
-
 
28
   */
-
 
29
  private static final long serialVersionUID = 1L;
23
30
24
        private Integer id;
31
  private Integer id;
25
        private String username;
32
  private String username;
26
        private String password;
33
  private String password;
27
        private String firstname;
34
  private String firstname;
28
        private String lastname;
35
  private String lastname;
29
        private boolean admin;
36
  private boolean admin;
30
        private Set<Object> objectsForOwnerId = new HashSet<Object>(0);
37
  private Set<ObjectEntity> objectsForOwnerId = new HashSet<ObjectEntity>(0);
31
        private Set<Object> objectsForEditorId = new HashSet<Object>(0);
38
  private Set<ObjectEntity> objectsForEditorId = new HashSet<ObjectEntity>(0);
32
        private Set<History> histories = new HashSet<History>(0);
39
  private Set<History> histories = new HashSet<History>(0);
33
40
34
        public User() {
41
  public User()
-
 
42
  {
35
        }
43
  }
36
44
37
        public User(String username, String password, boolean admin) {
45
  public User(String username, String password, boolean admin)
-
 
46
  {
38
                this.username = username;
47
    this.username = username;
39
                this.password = password;
48
    this.password = password;
40
                this.admin = admin;
49
    this.admin = admin;
41
        }
50
  }
42
51
43
        public User(String username, String password, String firstname,
52
  public User(String username, String password, String firstname,
44
                        String lastname, boolean admin, Set<Object> objectsForOwnerId,
53
      String lastname, boolean admin, Set<ObjectEntity> objectsForOwnerId,
45
                        Set<Object> objectsForEditorId, Set<History> histories) {
54
      Set<ObjectEntity> objectsForEditorId, Set<History> histories)
-
 
55
  {
46
                this.username = username;
56
    this.username = username;
47
                this.password = password;
57
    this.password = password;
48
                this.firstname = firstname;
58
    this.firstname = firstname;
49
                this.lastname = lastname;
59
    this.lastname = lastname;
50
                this.admin = admin;
60
    this.admin = admin;
Line 54... Line 64...
54
        }
64
  }
55
65
56
        @Id
66
  @Id
57
        @GeneratedValue(strategy = IDENTITY)
67
  @GeneratedValue(strategy = IDENTITY)
58
        @Column(name = "id", unique = true, nullable = false)
68
  @Column(name = "id", unique = true, nullable = false)
59
        public Integer getId() {
69
  public Integer getId()
-
 
70
  {
60
                return this.id;
71
    return this.id;
61
        }
72
  }
62
73
63
        public void setId(Integer id) {
74
  public void setId(Integer id)
-
 
75
  {
64
                this.id = id;
76
    this.id = id;
65
        }
77
  }
66
78
67
        @Column(name = "username", unique = true, nullable = false)
79
  @Column(name = "username", unique = true, nullable = false)
68
        public String getUsername() {
80
  public String getUsername()
-
 
81
  {
69
                return this.username;
82
    return this.username;
70
        }
83
  }
71
84
72
        public void setUsername(String username) {
85
  public void setUsername(String username)
-
 
86
  {
73
                this.username = username;
87
    this.username = username;
74
        }
88
  }
75
89
76
        @Column(name = "password", nullable = false, length = 32)
90
  @Column(name = "password", nullable = false, length = 32)
77
        public String getPassword() {
91
  public String getPassword()
-
 
92
  {
78
                return this.password;
93
    return this.password;
79
        }
94
  }
80
95
81
        public void setPassword(String password) {
96
  public void setPassword(String password)
-
 
97
  {
82
                this.password = password;
98
    this.password = password;
83
        }
99
  }
84
100
85
        @Column(name = "firstname", length = 45)
101
  @Column(name = "firstname", length = 45)
86
        public String getFirstname() {
102
  public String getFirstname()
-
 
103
  {
87
                return this.firstname;
104
    return this.firstname;
88
        }
105
  }
89
106
90
        public void setFirstname(String firstname) {
107
  public void setFirstname(String firstname)
-
 
108
  {
91
                this.firstname = firstname;
109
    this.firstname = firstname;
92
        }
110
  }
93
111
94
        @Column(name = "lastname", length = 45)
112
  @Column(name = "lastname", length = 45)
95
        public String getLastname() {
113
  public String getLastname()
-
 
114
  {
96
                return this.lastname;
115
    return this.lastname;
97
        }
116
  }
98
117
99
        public void setLastname(String lastname) {
118
  public void setLastname(String lastname)
-
 
119
  {
100
                this.lastname = lastname;
120
    this.lastname = lastname;
101
        }
121
  }
102
122
103
        @Column(name = "admin", nullable = false)
123
  @Column(name = "admin", nullable = false)
104
        public boolean isAdmin() {
124
  public boolean isAdmin()
-
 
125
  {
105
                return this.admin;
126
    return this.admin;
106
        }
127
  }
107
128
108
        public void setAdmin(boolean admin) {
129
  public void setAdmin(boolean admin)
-
 
130
  {
109
                this.admin = admin;
131
    this.admin = admin;
110
        }
132
  }
111
133
112
        @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByOwnerId")
134
  @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByOwnerId")
113
        public Set<Object> getObjectsForOwnerId() {
135
  public Set<ObjectEntity> getObjectsForOwnerId()
-
 
136
  {
114
                return this.objectsForOwnerId;
137
    return this.objectsForOwnerId;
115
        }
138
  }
116
139
117
        public void setObjectsForOwnerId(Set<Object> objectsForOwnerId) {
140
  public void setObjectsForOwnerId(Set<ObjectEntity> objectsForOwnerId)
-
 
141
  {
118
                this.objectsForOwnerId = objectsForOwnerId;
142
    this.objectsForOwnerId = objectsForOwnerId;
119
        }
143
  }
120
144
121
        @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByEditorId")
145
  @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByEditorId")
122
        public Set<Object> getObjectsForEditorId() {
146
  public Set<ObjectEntity> getObjectsForEditorId()
-
 
147
  {
123
                return this.objectsForEditorId;
148
    return this.objectsForEditorId;
124
        }
149
  }
125
150
126
        public void setObjectsForEditorId(Set<Object> objectsForEditorId) {
151
  public void setObjectsForEditorId(Set<ObjectEntity> objectsForEditorId)
-
 
152
  {
127
                this.objectsForEditorId = objectsForEditorId;
153
    this.objectsForEditorId = objectsForEditorId;
128
        }
154
  }
129
155
130
        @OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
156
  @OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
131
        public Set<History> getHistories() {
157
  public Set<History> getHistories()
-
 
158
  {
132
                return this.histories;
159
    return this.histories;
133
        }
160
  }
134
161
135
        public void setHistories(Set<History> histories) {
162
  public void setHistories(Set<History> histories)
-
 
163
  {
136
                this.histories = histories;
164
    this.histories = histories;
137
        }
165
  }
138
166
139
}
167
}