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

82 lines
1.8 KiB
Java

package eu.eudat.entities;
import java.io.Serializable;
import java.util.UUID;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
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="\"DatasetRegistry\"")
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
public class DatasetRegistry implements Serializable {
private static final long serialVersionUID = -5594183793725819187L;
public DatasetRegistry () {}
@Id
@GeneratedValue
@GenericGenerator(name = "uuid2", strategy = "uuid2")
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
private UUID id;
@Type(type="org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
@Column(name = "\"Dataset\"", nullable = false)
private UUID dataset;
@Type(type="org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
@Column(name = "\"Registry\"", nullable = false)
private UUID registry;
@Column(name = "\"Role\"")
private Integer role;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public UUID getDataset() {
return dataset;
}
public void setDataset(UUID dataset) {
this.dataset = dataset;
}
public UUID getRegistry() {
return registry;
}
public void setRegistry(UUID registry) {
this.registry = registry;
}
public Integer getRole() {
return role;
}
public void setRole(Integer role) {
this.role = role;
}
}