argos/dmp-backend/src/main/java/entities/UserInfo.java

181 lines
4.1 KiB
Java
Raw Normal View History

package entities;
import java.io.Serializable;
2017-10-12 17:41:20 +02:00
import java.util.Date;
import java.util.Set;
import java.util.UUID;
import javax.persistence.Column;
import javax.persistence.Entity;
2017-10-12 17:41:20 +02:00
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
2017-10-12 17:41:20 +02:00
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
2017-10-12 17:41:20 +02:00
import javax.persistence.OneToOne;
import javax.persistence.Table;
2017-10-12 17:41:20 +02:00
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Proxy;
import org.hibernate.annotations.Type;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import entities.security.UserAuth;
@Entity
@Table(name="\"UserInfo\"")
//@Proxy(lazy = false)
//@JsonInclude(Include.NON_NULL)
@JsonIdentityInfo(generator=ObjectIdGenerators.UUIDGenerator.class, property="id")
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-10-12 17:41:20 +02:00
@Column(name = "email", nullable = false)
private String email = null;
2017-10-12 17:41:20 +02:00
@Column(name = "authorization_level", nullable = false)
private Short authorization_level; //0 admin, 1 user
2017-10-12 17:41:20 +02:00
@Column(name = "usertype", nullable = false)
private Short usertype; // 0 internal, 1 external
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-10-12 17:41:20 +02:00
@Column(name = "created", nullable = false)
private Date created = null;
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;
@OneToMany(fetch = FetchType.LAZY)
@JoinTable(name="\"UserProject\"",
2017-10-19 14:31:36 +02:00
joinColumns={@JoinColumn(name="usr", referencedColumnName="id")},
inverseJoinColumns={@JoinColumn(name="project", referencedColumnName="\"ID\"")}
2017-10-19 14:31:36 +02:00
)
private Set<Project> projects;
2017-10-19 14:31:36 +02:00
public Set<Project> getProjects() {
return projects;
2017-10-19 14:31:36 +02:00
}
public void setProjects(Set<Project> projects) {
this.projects = projects;
2017-10-19 14:31:36 +02:00
}
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-10-12 17:41:20 +02:00
2017-10-18 12:20:04 +02:00
public void setLastloggedin(Date lastloggedin) {
this.lastloggedin = lastloggedin;
}
2017-10-12 17:41:20 +02:00
public String getEmail() {
return email;
}
2017-10-12 17:41:20 +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-10-12 17:41:20 +02:00
public void setAuthorization_level(Short authorization_level) {
this.authorization_level = authorization_level;
}
2017-10-12 17:41:20 +02:00
public Short getUsertype() {
return usertype;
}
2017-10-12 17:41:20 +02:00
public void setUsertype(Short usertype) {
this.usertype = usertype;
}
2017-10-12 17:41:20 +02:00
public UserAuth getAuthentication() {
return authentication;
}
2017-10-12 17:41:20 +02:00
public void setAuthentication(UserAuth authentication) {
this.authentication = authentication;
}
2017-10-12 17:41:20 +02:00
public Boolean getVerified_email() {
return verified_email;
}
2017-10-12 17:41:20 +02:00
public void setVerified_email(Boolean verified_email) {
this.verified_email = verified_email;
}
2017-10-12 17:41:20 +02:00
public String getName() {
return name;
}
2017-10-12 17:41:20 +02:00
public void setName(String name) {
this.name = name;
}
public String getAdditionalinfo() {
return additionalinfo;
}
public void setAdditionalinfo(String additionalinfo) {
this.additionalinfo = additionalinfo;
}
2017-10-12 17:41:20 +02:00
}