63 lines
1.2 KiB
Java
63 lines
1.2 KiB
Java
|
package stirling.software.SPDF.model;
|
||
|
|
||
|
import java.util.Set;
|
||
|
|
||
|
import jakarta.persistence.CascadeType;
|
||
|
import jakarta.persistence.Column;
|
||
|
import jakarta.persistence.Entity;
|
||
|
import jakarta.persistence.FetchType;
|
||
|
import jakarta.persistence.Id;
|
||
|
import jakarta.persistence.OneToMany;
|
||
|
import jakarta.persistence.Table;
|
||
|
|
||
|
@Entity
|
||
|
@Table(name = "users")
|
||
|
public class User {
|
||
|
|
||
|
@Id
|
||
|
@Column(name = "username")
|
||
|
private String username;
|
||
|
|
||
|
@Column(name = "password")
|
||
|
private String password;
|
||
|
|
||
|
@Column(name = "enabled")
|
||
|
private boolean enabled;
|
||
|
|
||
|
@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "user")
|
||
|
private Set<Authority> authorities;
|
||
|
|
||
|
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 Set<Authority> getAuthorities() {
|
||
|
return authorities;
|
||
|
}
|
||
|
|
||
|
public void setAuthorities(Set<Authority> authorities) {
|
||
|
this.authorities = authorities;
|
||
|
}
|
||
|
|
||
|
}
|