ulrich@undisclosed
2020-05-12 14cc29f3e69c002c11b674e018a1106a632f5a81
commit | author | age
c65695 1 /*
U 2  *  Nutzerverwaltung - User and role management in your browser
51c9e3 3  *  Copyright (C) 2011-2016 Ulrich Hilger, http://uhilger.de
c65695 4  *
U 5  *  This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation, either version 3 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program.  If not, see http://www.gnu.org/licenses/
17  */
18
19 package de.uhilger.um.daten;
20
21 import java.io.Serializable;
22
23 import de.uhilger.baselink.DBColumn;
24 import de.uhilger.baselink.DBPrimaryKey;
25 import de.uhilger.baselink.DBTable;
26
27
28 @DBTable(name="app.users")
29 @DBPrimaryKey({"user_name"})
30 public class User implements Serializable {
31
32   private static final long serialVersionUID = 8274601049628620767L;
33   private String id;
34   private String pw;
35   private String firstName;
36   private String lastName;
37   private String email;
38
39   public User() {
40     super();
41   }
42
43   @DBColumn(name = "user_name")
44   public String getId() {
45     return id;
46   }
47
48   public void setId(String id) {
49     this.id = id;
50   }
51
52   @DBColumn(name = "user_pass")
53   public String getPw() {
54     return pw;
55   }
56
57   public void setPw(String pw) {
58     this.pw = pw;
59   }
60
61   @DBColumn(name = "user_first")
62   public String getFirstName() {
63     return firstName;
64   }
65
66   public void setFirstName(String firstName) {
67     this.firstName = firstName;
68   }
69
70   @DBColumn(name = "user_last")
71   public String getLastName() {
72     return lastName;
73   }
74
75   public void setLastName(String lastName) {
76     this.lastName = lastName;
77   }
78
79   @DBColumn(name = "user_email")
80   public String getEmail() {
81     return email;
82   }
83
84   public void setEmail(String email) {
85     this.email = email;
86   }
87
88   @Override
89   public boolean equals(Object obj) {
90     boolean isEqual = false;
91     if(obj != null && obj instanceof User) {
92       User other = (User) obj;
93       isEqual = other.getId().equals(this.getId());
94     }
95     return isEqual;
96   }
97 }