Rev 18 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 18 | Rev 21 | ||
---|---|---|---|
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
|
|
- | 4 | ||
- | 5 | import java.util.HashSet; |
|
- | 6 | import java.util.Set; |
|
3 | import javax.persistence.Column; |
7 | import javax.persistence.Column; |
4 | import javax.persistence.Entity; |
8 | import javax.persistence.Entity; |
- | 9 | import javax.persistence.FetchType; |
|
5 | import javax.persistence.GeneratedValue; |
10 | import javax.persistence.GeneratedValue; |
- | 11 | import static javax.persistence.GenerationType.IDENTITY; |
|
6 | import javax.persistence.Id; |
12 | import javax.persistence.Id; |
- | 13 | import javax.persistence.OneToMany; |
|
7 | import javax.persistence.Table; |
14 | import javax.persistence.Table; |
- | 15 | import javax.persistence.UniqueConstraint; |
|
8 | 16 | ||
- | 17 | /**
|
|
- | 18 | * User generated by hbm2java
|
|
- | 19 | */
|
|
9 | @Entity |
20 | @Entity |
10 | @Table(name="user") |
21 | @Table(name = "user", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = "username")) |
11 | public class User { |
22 | public class User implements java.io.Serializable { |
12 | - | ||
13 | 23 | ||
14 | private int id; |
24 | private Integer id; |
15 | private String username; |
25 | private String username; |
16 | private String password; |
26 | private String password; |
17 | - | ||
18 | private String firstname; |
27 | private String firstname; |
19 | private String lastname; |
28 | private String lastname; |
20 | private boolean admin; |
29 | private boolean admin; |
- | 30 | private Set<Object> objectsForOwnerId = new HashSet<Object>(0); |
|
- | 31 | private Set<Object> objectsForEditorId = new HashSet<Object>(0); |
|
- | 32 | private Set<History> histories = new HashSet<History>(0); |
|
21 | 33 | ||
- | 34 | public User() { |
|
- | 35 | }
|
|
- | 36 | ||
- | 37 | public User(String username, String password, boolean admin) { |
|
- | 38 | this.username = username; |
|
- | 39 | this.password = password; |
|
- | 40 | this.admin = admin; |
|
- | 41 | }
|
|
- | 42 | ||
- | 43 | public User(String username, String password, String firstname, |
|
- | 44 | String lastname, boolean admin, Set<Object> objectsForOwnerId, |
|
- | 45 | Set<Object> objectsForEditorId, Set<History> histories) { |
|
- | 46 | this.username = username; |
|
- | 47 | this.password = password; |
|
- | 48 | this.firstname = firstname; |
|
- | 49 | this.lastname = lastname; |
|
- | 50 | this.admin = admin; |
|
- | 51 | this.objectsForOwnerId = objectsForOwnerId; |
|
- | 52 | this.objectsForEditorId = objectsForEditorId; |
|
- | 53 | this.histories = histories; |
|
- | 54 | }
|
|
- | 55 | ||
22 | @Id |
56 | @Id |
23 | @GeneratedValue |
57 | @GeneratedValue(strategy = IDENTITY) |
24 | @Column(name="id") |
58 | @Column(name = "id", unique = true, nullable = false) |
25 | public int getId() { |
59 | public Integer getId() { |
26 | return id; |
60 | return this.id; |
27 | }
|
61 | }
|
- | 62 | ||
28 | public void setId(int id) { |
63 | public void setId(Integer id) { |
29 | this.id = id; |
64 | this.id = id; |
30 | }
|
65 | }
|
31 | 66 | ||
32 | @Column(name="username") |
67 | @Column(name = "username", unique = true, nullable = false) |
33 | public String getUsername() { |
68 | public String getUsername() { |
34 | return username; |
69 | return this.username; |
35 | }
|
70 | }
|
- | 71 | ||
36 | public void setUsername(String username) { |
72 | public void setUsername(String username) { |
37 | this.username = username; |
73 | this.username = username; |
38 | }
|
74 | }
|
39 | 75 | ||
- | 76 | @Column(name = "password", nullable = false, length = 32) |
|
- | 77 | public String getPassword() { |
|
- | 78 | return this.password; |
|
- | 79 | }
|
|
- | 80 | ||
- | 81 | public void setPassword(String password) { |
|
- | 82 | this.password = password; |
|
- | 83 | }
|
|
- | 84 | ||
- | 85 | @Column(name = "firstname", length = 45) |
|
- | 86 | public String getFirstname() { |
|
- | 87 | return this.firstname; |
|
- | 88 | }
|
|
- | 89 | ||
- | 90 | public void setFirstname(String firstname) { |
|
- | 91 | this.firstname = firstname; |
|
- | 92 | }
|
|
- | 93 | ||
40 | @Column(name="lastname") |
94 | @Column(name = "lastname", length = 45) |
41 | public String getLastname() { |
95 | public String getLastname() { |
42 | return lastname; |
96 | return this.lastname; |
43 | }
|
97 | }
|
- | 98 | ||
44 | public void setLastname(String lastname) { |
99 | public void setLastname(String lastname) { |
45 | this.lastname = lastname; |
100 | this.lastname = lastname; |
46 | }
|
101 | }
|
47 | 102 | ||
48 | @Column(name="admin") |
103 | @Column(name = "admin", nullable = false) |
49 | public boolean isAdmin() { |
104 | public boolean isAdmin() { |
50 | return admin; |
105 | return this.admin; |
51 | }
|
106 | }
|
- | 107 | ||
52 | public void setAdmin(boolean admin) { |
108 | public void setAdmin(boolean admin) { |
53 | this.admin = admin; |
109 | this.admin = admin; |
54 | }
|
110 | }
|
55 | 111 | ||
56 | @Column(name="firstname") |
112 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByOwnerId") |
57 | public void setFirstname(String firstname) { |
113 | public Set<Object> getObjectsForOwnerId() { |
58 | this.firstname = firstname; |
114 | return this.objectsForOwnerId; |
59 | }
|
115 | }
|
- | 116 | ||
60 | public String getFirstname() { |
117 | public void setObjectsForOwnerId(Set<Object> objectsForOwnerId) { |
61 | return firstname; |
118 | this.objectsForOwnerId = objectsForOwnerId; |
62 | }
|
119 | }
|
63 | 120 | ||
64 | @Column(name="password") |
121 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByEditorId") |
65 | public String getPassword() { |
122 | public Set<Object> getObjectsForEditorId() { |
66 | return password; |
123 | return this.objectsForEditorId; |
67 | }
|
124 | }
|
- | 125 | ||
68 | public void setPassword(String password) { |
126 | public void setObjectsForEditorId(Set<Object> objectsForEditorId) { |
69 | this.password = password; |
127 | this.objectsForEditorId = objectsForEditorId; |
- | 128 | }
|
|
- | 129 | ||
- | 130 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "user") |
|
- | 131 | public Set<History> getHistories() { |
|
- | 132 | return this.histories; |
|
70 | }
|
133 | }
|
- | 134 | ||
- | 135 | public void setHistories(Set<History> histories) { |
|
- | 136 | this.histories = histories; |
|
- | 137 | }
|
|
- | 138 | ||
71 | }
|
139 | }
|