2017-09-28 12:32:03 +02:00
|
|
|
package entities.security;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
2017-10-12 17:41:20 +02:00
|
|
|
import java.util.Date;
|
2017-09-28 12:32:03 +02:00
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
import javax.persistence.Column;
|
|
|
|
import javax.persistence.Entity;
|
2017-10-12 17:41:20 +02:00
|
|
|
import javax.persistence.FetchType;
|
2017-09-28 12:32:03 +02:00
|
|
|
import javax.persistence.GeneratedValue;
|
|
|
|
import javax.persistence.Id;
|
2017-10-12 17:41:20 +02:00
|
|
|
import javax.persistence.JoinColumn;
|
|
|
|
import javax.persistence.OneToOne;
|
2017-09-28 12:32:03 +02:00
|
|
|
import javax.persistence.Table;
|
2017-10-12 17:41:20 +02:00
|
|
|
import javax.persistence.Temporal;
|
|
|
|
import javax.persistence.TemporalType;
|
2017-09-28 12:32:03 +02:00
|
|
|
|
|
|
|
import org.hibernate.annotations.GenericGenerator;
|
|
|
|
import org.hibernate.annotations.Type;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
|
|
|
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|
|
|
|
|
|
|
|
|
|
|
@Entity
|
|
|
|
@Table(name="\"UserInfo\"")
|
|
|
|
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="autoid")
|
|
|
|
public class UserInfo implements Serializable{
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 1225151430484658395L;
|
|
|
|
|
|
|
|
@Id
|
|
|
|
@GeneratedValue
|
|
|
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
2017-10-18 12:20:04 +02:00
|
|
|
@Column(name = "id", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
|
|
|
private UUID id;
|
2017-09-28 12:32:03 +02:00
|
|
|
|
|
|
|
|
2017-10-12 17:41:20 +02:00
|
|
|
@Column(name = "email", nullable = false)
|
|
|
|
private String email = null;
|
2017-09-28 12:32:03 +02:00
|
|
|
|
2017-10-12 17:41:20 +02:00
|
|
|
@Column(name = "authorization_level", nullable = false)
|
|
|
|
private Short authorization_level; //0 admin, 1 user
|
2017-09-28 12:32:03 +02:00
|
|
|
|
2017-10-12 17:41:20 +02:00
|
|
|
@Column(name = "usertype", nullable = false)
|
|
|
|
private Short usertype; // 0 internal, 1 external
|
2017-09-28 12:32:03 +02:00
|
|
|
|
2017-10-12 17:41:20 +02:00
|
|
|
@OneToOne(fetch = FetchType.LAZY)
|
|
|
|
@JoinColumn(name = "authentication", nullable = true)
|
|
|
|
private UserAuth authentication;
|
|
|
|
|
|
|
|
@Column(name = "verified_email", nullable = true)
|
|
|
|
private Boolean verified_email = null;
|
|
|
|
|
|
|
|
@Column(name = "name", nullable = true)
|
|
|
|
private String name = null;
|
2017-09-28 12:32:03 +02:00
|
|
|
|
|
|
|
|
2017-10-12 17:41:20 +02:00
|
|
|
@Column(name = "created", nullable = false)
|
|
|
|
private Date created = null;
|
2017-09-28 12:32:03 +02:00
|
|
|
|
|
|
|
|
2017-10-12 17:41:20 +02:00
|
|
|
@Column(name = "lastloggedin", nullable = true)
|
|
|
|
private Date lastloggedin = null;
|
|
|
|
|
|
|
|
|
|
|
|
@Type(type="typedefinition.XMLType")
|
|
|
|
@Column(name = "additionalinfo", columnDefinition = "xml", nullable = true)
|
|
|
|
private String additionalinfo;
|
|
|
|
|
2017-10-18 12:20:04 +02:00
|
|
|
|
|
|
|
public UUID getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setId(UUID id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getCreated() {
|
|
|
|
return created;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCreated(Date created) {
|
|
|
|
this.created = created;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getLastloggedin() {
|
|
|
|
return lastloggedin;
|
2017-09-28 12:32:03 +02:00
|
|
|
}
|
2017-10-12 17:41:20 +02:00
|
|
|
|
2017-10-18 12:20:04 +02:00
|
|
|
public void setLastloggedin(Date lastloggedin) {
|
|
|
|
this.lastloggedin = lastloggedin;
|
2017-09-28 12:32:03 +02:00
|
|
|
}
|
2017-10-12 17:41:20 +02:00
|
|
|
|
2017-09-28 12:32:03 +02:00
|
|
|
public String getEmail() {
|
|
|
|
return email;
|
|
|
|
}
|
2017-10-12 17:41:20 +02:00
|
|
|
|
2017-09-28 12:32:03 +02:00
|
|
|
public void setEmail(String email) {
|
|
|
|
this.email = email;
|
|
|
|
}
|
2017-10-12 17:41:20 +02:00
|
|
|
|
|
|
|
public Short getAuthorization_level() {
|
|
|
|
return authorization_level;
|
2017-09-28 12:32:03 +02:00
|
|
|
}
|
2017-10-12 17:41:20 +02:00
|
|
|
|
|
|
|
public void setAuthorization_level(Short authorization_level) {
|
|
|
|
this.authorization_level = authorization_level;
|
2017-09-28 12:32:03 +02:00
|
|
|
}
|
2017-10-12 17:41:20 +02:00
|
|
|
|
|
|
|
public Short getUsertype() {
|
|
|
|
return usertype;
|
2017-09-28 12:32:03 +02:00
|
|
|
}
|
2017-10-12 17:41:20 +02:00
|
|
|
|
|
|
|
public void setUsertype(Short usertype) {
|
|
|
|
this.usertype = usertype;
|
2017-09-28 12:32:03 +02:00
|
|
|
}
|
2017-10-12 17:41:20 +02:00
|
|
|
|
|
|
|
public UserAuth getAuthentication() {
|
|
|
|
return authentication;
|
2017-09-28 12:32:03 +02:00
|
|
|
}
|
2017-10-12 17:41:20 +02:00
|
|
|
|
|
|
|
public void setAuthentication(UserAuth authentication) {
|
|
|
|
this.authentication = authentication;
|
2017-09-28 12:32:03 +02:00
|
|
|
}
|
2017-10-12 17:41:20 +02:00
|
|
|
|
|
|
|
public Boolean getVerified_email() {
|
|
|
|
return verified_email;
|
2017-09-28 12:32:03 +02:00
|
|
|
}
|
|
|
|
|
2017-10-12 17:41:20 +02:00
|
|
|
public void setVerified_email(Boolean verified_email) {
|
|
|
|
this.verified_email = verified_email;
|
|
|
|
}
|
2017-09-28 12:32:03 +02:00
|
|
|
|
2017-10-12 17:41:20 +02:00
|
|
|
public String getName() {
|
|
|
|
return name;
|
2017-09-28 12:32:03 +02:00
|
|
|
}
|
|
|
|
|
2017-10-12 17:41:20 +02:00
|
|
|
public void setName(String name) {
|
|
|
|
this.name = name;
|
2017-09-28 12:32:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public String getAdditionalinfo() {
|
|
|
|
return additionalinfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setAdditionalinfo(String additionalinfo) {
|
|
|
|
this.additionalinfo = additionalinfo;
|
|
|
|
}
|
2017-10-12 17:41:20 +02:00
|
|
|
|
2017-09-28 12:32:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
}
|