2017-10-18 15:12:25 +02:00
|
|
|
package entities;
|
2017-09-28 12:32:03 +02:00
|
|
|
|
|
|
|
import java.io.Serializable;
|
2017-10-12 17:41:20 +02:00
|
|
|
import java.util.Date;
|
2017-10-18 15:12:25 +02:00
|
|
|
import java.util.Set;
|
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;
|
2017-10-18 15:12:25 +02:00
|
|
|
import javax.persistence.JoinTable;
|
|
|
|
import javax.persistence.OneToMany;
|
2017-10-12 17:41:20 +02:00
|
|
|
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;
|
2017-10-20 17:11:40 +02:00
|
|
|
import org.hibernate.annotations.Proxy;
|
2017-09-28 12:32:03 +02:00
|
|
|
import org.hibernate.annotations.Type;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
2017-10-20 17:11:40 +02:00
|
|
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
2017-09-28 12:32:03 +02:00
|
|
|
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
2017-10-20 17:11:40 +02:00
|
|
|
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
2017-09-28 12:32:03 +02:00
|
|
|
|
2017-10-18 15:12:25 +02:00
|
|
|
import entities.security.UserAuth;
|
|
|
|
|
2017-09-28 12:32:03 +02:00
|
|
|
|
|
|
|
@Entity
|
|
|
|
@Table(name="\"UserInfo\"")
|
2017-10-20 17:11:40 +02:00
|
|
|
//@Proxy(lazy = false)
|
|
|
|
//@JsonInclude(Include.NON_NULL)
|
|
|
|
@JsonIdentityInfo(generator=ObjectIdGenerators.UUIDGenerator.class, property="id")
|
2017-09-28 12:32:03 +02:00
|
|
|
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-20 17:11:40 +02:00
|
|
|
@OneToMany(fetch = FetchType.LAZY)
|
2017-10-23 18:06:24 +02:00
|
|
|
@JoinTable(name="\"UserProject\"",
|
2017-10-19 14:31:36 +02:00
|
|
|
joinColumns={@JoinColumn(name="usr", referencedColumnName="id")},
|
2017-10-23 18:06:24 +02:00
|
|
|
inverseJoinColumns={@JoinColumn(name="project", referencedColumnName="\"ID\"")}
|
2017-10-19 14:31:36 +02:00
|
|
|
)
|
2017-10-23 18:06:24 +02:00
|
|
|
private Set<Project> projects;
|
2017-10-18 15:12:25 +02:00
|
|
|
|
2017-10-19 14:31:36 +02:00
|
|
|
|
2017-10-23 18:06:24 +02:00
|
|
|
public Set<Project> getProjects() {
|
|
|
|
return projects;
|
2017-10-19 14:31:36 +02:00
|
|
|
}
|
|
|
|
|
2017-10-23 18:06:24 +02:00
|
|
|
public void setProjects(Set<Project> projects) {
|
|
|
|
this.projects = projects;
|
2017-10-19 14:31:36 +02:00
|
|
|
}
|
|
|
|
|
2017-10-18 15:12:25 +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-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
|
|
|
|
|
|
|
|
|
|
|
}
|