argos/dmp-backend/src/main/java/eu/eudat/entities/Researcher.java

177 lines
3.4 KiB
Java
Raw Normal View History

2017-12-15 00:01:26 +01:00
package eu.eudat.entities;
import java.io.Serializable;
import java.util.Date;
import java.util.Set;
import java.util.UUID;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.Table;
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="\"Researcher\"")
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
public class Researcher implements Serializable,DataEntity<Researcher> {
private static final long serialVersionUID = -2513186824704729896L;
public Researcher () {}
@Id
@GeneratedValue
@GenericGenerator(name = "uuid2", strategy = "uuid2")
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
private UUID id;
@Column(name = "\"Label\"")
private String label;
@Column(name = "\"Uri\"")
private String uri;
@Column(name = "\"PrimaryEmail\"")
private String primaryEmail;
2017-12-15 00:01:26 +01:00
@Type(type="eu.eudat.typedefinition.XMLType")
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
private String definition;
2017-12-15 00:01:26 +01:00
@Type(type="eu.eudat.typedefinition.XMLType")
@Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true)
private String reference;
@OneToMany(fetch = FetchType.LAZY)
@JoinTable(name="\"DMPResearcher\"",
joinColumns={@JoinColumn(name="\"Researcher\"", referencedColumnName="\"ID\"")},
inverseJoinColumns={@JoinColumn(name="\"DMP\"", referencedColumnName="\"ID\"")}
)
private Set<DMP> dMPs;
@Column(name = "\"Status\"", nullable = false)
private Short status;
@Column(name = "\"Created\"")
private Date created = null;
@Column(name = "\"Modified\"")
private Date modified = new Date();
public Short getStatus() {
return status;
}
public void setStatus(Short status) {
this.status = status;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getPrimaryEmail() {
return primaryEmail;
}
public void setPrimaryEmail(String primaryEmail) {
this.primaryEmail = primaryEmail;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getDefinition() {
return definition;
}
public void setDefinition(String definition) {
this.definition = definition;
}
public Set<DMP> getdMPs() {
return dMPs;
}
public void setdMPs(Set<DMP> dMPs) {
this.dMPs = dMPs;
}
@Override
public void update(Researcher entity) {
}
@Override
public Object[] getKeys() {
return new UUID[]{this.id == null ? null : this.id};
}
}