* Revert "[BAEL-3066] Spring Security: Exploring JDBC Authentication (#7441)" This reverts commit 5aecdeb0211c9dc44e3e5138d4a30bf837d19204. * Redone Spring-Security-Exploring-JDBC-Authentication code, now witout using submodules
84 lines
1.6 KiB
Java
84 lines
1.6 KiB
Java
package com.baeldung.models;
|
|
|
|
import java.util.Date;
|
|
|
|
import javax.persistence.Column;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.GeneratedValue;
|
|
import javax.persistence.GenerationType;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.Table;
|
|
|
|
@Entity
|
|
@Table(name = "users")
|
|
public class AppUser {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.SEQUENCE)
|
|
private long id;
|
|
|
|
private String name;
|
|
@Column(unique = true)
|
|
private String username;
|
|
private String password;
|
|
private boolean enabled = true;
|
|
private Date lastLogin;
|
|
|
|
private AppUser() {
|
|
}
|
|
|
|
public AppUser(String name, String email, String password) {
|
|
this.username = email;
|
|
this.name = name;
|
|
this.password = password;
|
|
}
|
|
|
|
public long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public String getUsername() {
|
|
return username;
|
|
}
|
|
|
|
public void setUsername(String username) {
|
|
this.username = username;
|
|
}
|
|
|
|
public String getPassword() {
|
|
return password;
|
|
}
|
|
|
|
public void setPassword(String password) {
|
|
this.password = password;
|
|
}
|
|
|
|
public boolean isEnabled() {
|
|
return enabled;
|
|
}
|
|
|
|
public void setEnabled(boolean enabled) {
|
|
this.enabled = enabled;
|
|
}
|
|
|
|
public Date getLastLogin() {
|
|
return lastLogin;
|
|
}
|
|
|
|
public void setLastLogin(Date lastLogin) {
|
|
this.lastLogin = lastLogin;
|
|
}
|
|
}
|