Subversion Repositories WebE

Rev

Rev 18 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
18 moos 1
package ch.ffhs.webE.domain;
2
 
21 moos 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;
18 moos 7
import javax.persistence.Column;
8
import javax.persistence.Entity;
21 moos 9
import javax.persistence.FetchType;
18 moos 10
import javax.persistence.GeneratedValue;
21 moos 11
import static javax.persistence.GenerationType.IDENTITY;
18 moos 12
import javax.persistence.Id;
21 moos 13
import javax.persistence.OneToMany;
18 moos 14
import javax.persistence.Table;
21 moos 15
import javax.persistence.UniqueConstraint;
18 moos 16
 
21 moos 17
/**
18
 * User generated by hbm2java
19
 */
18 moos 20
@Entity
21 moos 21
@Table(name = "user", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = "username"))
22
public class User implements java.io.Serializable {
18 moos 23
 
21 moos 24
        private Integer id;
18 moos 25
        private String username;
26
        private String password;
27
        private String firstname;
28
        private String lastname;
29
        private boolean admin;
21 moos 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);
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
 
18 moos 56
        @Id
21 moos 57
        @GeneratedValue(strategy = IDENTITY)
58
        @Column(name = "id", unique = true, nullable = false)
59
        public Integer getId() {
60
                return this.id;
18 moos 61
        }
21 moos 62
 
63
        public void setId(Integer id) {
18 moos 64
                this.id = id;
65
        }
21 moos 66
 
67
        @Column(name = "username", unique = true, nullable = false)
18 moos 68
        public String getUsername() {
21 moos 69
                return this.username;
18 moos 70
        }
21 moos 71
 
18 moos 72
        public void setUsername(String username) {
73
                this.username = username;
74
        }
21 moos 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
 
94
        @Column(name = "lastname", length = 45)
18 moos 95
        public String getLastname() {
21 moos 96
                return this.lastname;
18 moos 97
        }
21 moos 98
 
18 moos 99
        public void setLastname(String lastname) {
100
                this.lastname = lastname;
101
        }
21 moos 102
 
103
        @Column(name = "admin", nullable = false)
18 moos 104
        public boolean isAdmin() {
21 moos 105
                return this.admin;
18 moos 106
        }
21 moos 107
 
18 moos 108
        public void setAdmin(boolean admin) {
109
                this.admin = admin;
110
        }
21 moos 111
 
112
        @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByOwnerId")
113
        public Set<Object> getObjectsForOwnerId() {
114
                return this.objectsForOwnerId;
18 moos 115
        }
21 moos 116
 
117
        public void setObjectsForOwnerId(Set<Object> objectsForOwnerId) {
118
                this.objectsForOwnerId = objectsForOwnerId;
18 moos 119
        }
21 moos 120
 
121
        @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByEditorId")
122
        public Set<Object> getObjectsForEditorId() {
123
                return this.objectsForEditorId;
18 moos 124
        }
21 moos 125
 
126
        public void setObjectsForEditorId(Set<Object> objectsForEditorId) {
127
                this.objectsForEditorId = objectsForEditorId;
18 moos 128
        }
21 moos 129
 
130
        @OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
131
        public Set<History> getHistories() {
132
                return this.histories;
133
        }
134
 
135
        public void setHistories(Set<History> histories) {
136
                this.histories = histories;
137
        }
138
 
18 moos 139
}