Open Kilda Java Documentation
UserEntity.java
Go to the documentation of this file.
1 package org.usermanagement.dao.entity;
2 
3 import java.io.Serializable;
4 import java.util.Date;
5 import java.util.HashSet;
6 import java.util.Set;
7 
8 import javax.persistence.Column;
9 import javax.persistence.Entity;
10 import javax.persistence.FetchType;
11 import javax.persistence.GeneratedValue;
12 import javax.persistence.GenerationType;
13 import javax.persistence.Id;
14 import javax.persistence.JoinColumn;
15 import javax.persistence.JoinTable;
16 import javax.persistence.ManyToMany;
17 import javax.persistence.ManyToOne;
18 import javax.persistence.Table;
19 
21 
25 @Entity
26 @Table(name = "KILDA_USER")
27 public class UserEntity extends BaseEntity implements Serializable {
28 
30  private static final long serialVersionUID = 1L;
31 
33  @Id
34  @Column(name = "USER_ID", nullable = false)
35  @GeneratedValue(strategy = GenerationType.SEQUENCE)
36  private Long userId;
37 
39  @Column(name = "USERNAME", nullable = false)
40  private String username;
41 
43  @Column(name = "PASSWORD", nullable = false)
44  private String password;
45 
47  @Column(name = "NAME")
48  private String name;
49 
51  @Column(name = "EMAIL")
52  private String email;
53 
55  @Column(name = "LOGIN_TIME")
56  private Date loginTime;
57 
59  @Column(name = "LOGOUT_TIME")
60  private Date logoutTime;
61 
63  @Column(name = "ACTIVE_FLAG")
64  private String activeFlag;
65 
67  @Column(name = "IS_AUTHORIZED")
68  private String isAuthorized;
69 
71  @Column(name = "is_two_fa_enabled", nullable = true)
72  private Boolean is2FaEnabled;
73 
74  @Column(name = "two_fa_key", nullable = true)
75  private String twoFaKey;
76 
77  @Column(name = "is_two_fa_configured", nullable = true)
78  private Boolean is2FaConfigured;
79 
80  @ManyToOne
81  @JoinColumn(name = "status_id", nullable = false)
82  private StatusEntity statusEntity;
83 
85  @ManyToMany(fetch = FetchType.EAGER)
86  @JoinTable(name = "user_role", joinColumns = {@JoinColumn(name = "user_id")},
87  inverseJoinColumns = {@JoinColumn(name = "role_id")})
88  private Set<RoleEntity> roles = new HashSet<RoleEntity>();
89 
95  public Set<RoleEntity> getRoles() {
96  return roles;
97  }
98 
104  public void setRoles(final Set<RoleEntity> roles) {
105  this.roles = roles;
106  }
107 
113  public Long getUserId() {
114  return userId;
115  }
116 
122  public void setUserId(final Long userId) {
123  this.userId = userId;
124  }
125 
131  public String getUsername() {
132  return username;
133  }
134 
140  public void setUsername(final String username) {
141  this.username = username;
142  }
143 
149  public String getPassword() {
150  return password;
151  }
152 
158  public void setPassword(final String password) {
159  this.password = password;
160  }
161 
167  public String getName() {
168  return name;
169  }
170 
176  public void setName(final String name) {
177  this.name = name;
178  }
179 
185  public String getEmail() {
186  return email;
187  }
188 
194  public void setEmail(final String email) {
195  this.email = email;
196  }
197 
203  public Date getLoginTime() {
204  return loginTime;
205  }
206 
212  public void setLoginTime(final Date loginTime) {
213  this.loginTime = loginTime;
214  }
215 
221  public Date getLogoutTime() {
222  return logoutTime;
223  }
224 
230  public void setLogoutTime(final Date logoutTime) {
231  this.logoutTime = logoutTime;
232  }
233 
239  public Boolean getActiveFlag() {
240  return activeFlag.equalsIgnoreCase("true") ? true : false;
241  }
242 
248  public void setActiveFlag(final Boolean activeFlag) {
249  this.activeFlag = activeFlag.toString();
250  }
251 
257  public void setActiveFlag(final String activeFlag) {
258  this.activeFlag = activeFlag;
259  }
260 
266  public Boolean getIsAuthorized() {
267  return isAuthorized.equalsIgnoreCase("true") ? true : false;
268  }
269 
275  public void setIsAuthorized(final Boolean isAuthorized) {
276  this.isAuthorized = isAuthorized.toString();
277  }
278 
284  public void setIsAuthorized(final String isAuthorized) {
285  this.isAuthorized = isAuthorized;
286  }
287 
294  return statusEntity;
295  }
296 
302  public void setStatusEntity(final StatusEntity statusEntity) {
303  this.statusEntity = statusEntity;
304  }
305 
311  public boolean getIs2FaEnabled() {
312  return is2FaEnabled;
313  }
314 
320  public void setIs2FaEnabled(final boolean is2FaEnabled) {
321  this.is2FaEnabled = is2FaEnabled;
322  }
323 
329  public boolean getIs2FaConfigured() {
330  return is2FaConfigured;
331  }
332 
338  public void setIs2FaConfigured(final boolean is2FaConfigured) {
339  this.is2FaConfigured = is2FaConfigured;
340  }
341 
347  public String getTwoFaKey() {
348  return twoFaKey;
349  }
350 
356  public void setTwoFaKey(final String twoFaKey) {
357  this.twoFaKey = twoFaKey;
358  }
359 
360  /* (non-Javadoc)
361  * @see java.lang.Object#toString()
362  */
363  @Override
364  public String toString() {
365  return "UserEntity [userId=" + userId + ", username=" + username + ", password=" + password + ", name=" + name
366  + ", email=" + email + ", loginTime=" + loginTime + ", logoutTime=" + logoutTime + ", activeFlag="
367  + activeFlag + ", isAuthorized=" + isAuthorized + ", statusEntity=" + statusEntity + ", roles=" + roles
368  + "]";
369  }
370 }
void setIs2FaConfigured(final boolean is2FaConfigured)
void setRoles(final Set< RoleEntity > roles)
void setLogoutTime(final Date logoutTime)
void setUsername(final String username)
void setTwoFaKey(final String twoFaKey)
name
Definition: setup.py:24
void setIs2FaEnabled(final boolean is2FaEnabled)
void setIsAuthorized(final String isAuthorized)
void setPassword(final String password)
void setIsAuthorized(final Boolean isAuthorized)
void setLoginTime(final Date loginTime)
void setStatusEntity(final StatusEntity statusEntity)
void setActiveFlag(final Boolean activeFlag)
void setActiveFlag(final String activeFlag)