286 lines
7.1 KiB
Java
286 lines
7.1 KiB
Java
package eu.eudat.data;
|
|
|
|
import eu.eudat.commons.enums.DMPStatus;
|
|
import eu.eudat.commons.enums.IsActive;
|
|
import eu.eudat.data.converters.DateToUTCConverter;
|
|
import eu.eudat.data.converters.enums.IsActiveConverter;
|
|
import jakarta.persistence.*;
|
|
import org.hibernate.annotations.GenericGenerator;
|
|
|
|
import java.time.Instant;
|
|
import java.util.UUID;
|
|
|
|
//TODO: (thgiannos) Wire up when all other dependent entities are refactored
|
|
//@Entity
|
|
//@Table(name = "\"DMP\"")
|
|
public class DMPEntity {
|
|
|
|
@Id
|
|
@GeneratedValue
|
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
|
@Column(name = "id", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
|
private UUID id;
|
|
|
|
public static final String _id = "id";
|
|
|
|
@Column(name = "label")
|
|
private String label;
|
|
|
|
public static final String _label = "label";
|
|
|
|
@Column(name = "version")
|
|
private Integer version;
|
|
|
|
public static final String _version = "version";
|
|
|
|
@Enumerated(EnumType.STRING)
|
|
@Column(name = "status", nullable = false)
|
|
private DMPStatus status;
|
|
|
|
public static final String _status = "status";
|
|
|
|
@Column(name = "properties")
|
|
private String properties;
|
|
|
|
public static final String _properties = "properties";
|
|
|
|
@Column(name = "dmp_properties")
|
|
private String dmpProperties;
|
|
|
|
public static final String _dmpProperties = "dmpProperties";
|
|
|
|
@Column(name = "group_id", columnDefinition = "BINARY(16)")
|
|
private UUID groupId;
|
|
|
|
public static final String _groupId = "groupId";
|
|
|
|
@Column(name = "description")
|
|
private String description;
|
|
|
|
public static final String _description = "description";
|
|
|
|
@Column(name = "is_public", nullable = false)
|
|
private boolean isPublic;
|
|
|
|
public static final String _isPublic = "isPublic";
|
|
|
|
@Column(name = "extra_properties")
|
|
private String extraProperties;
|
|
|
|
public static final String _extraProperties = "extraProperties";
|
|
|
|
@Column(name = "created_at")
|
|
@Convert(converter = DateToUTCConverter.class)
|
|
private Instant createdAt;
|
|
|
|
public static final String _createdAt = "createdAt";
|
|
|
|
@Column(name = "updated_at")
|
|
@Convert(converter = DateToUTCConverter.class)
|
|
private Instant updatedAt;
|
|
|
|
public static final String _updatedAt = "updatedAt";
|
|
|
|
@Column(name = "is_active", nullable = false)
|
|
@Convert(converter = IsActiveConverter.class)
|
|
private IsActive isActive;
|
|
|
|
public static final String _isActive = "isActive";
|
|
|
|
//TODO: (thgiannos) Handle using the DMPEntity builder
|
|
// @OneToMany(mappedBy = "dmp", fetch = FetchType.LAZY)
|
|
// private Set<Dataset> dataset;
|
|
|
|
// @ManyToOne(fetch = FetchType.LAZY)
|
|
// @JoinColumn(name = "\"Grant\"")
|
|
//TODO: (thgiannos) Previously 'Grant'
|
|
private UUID grant;
|
|
|
|
//TODO: (thgiannos) Handle using the DMPEntity builder
|
|
// @OneToMany(fetch = FetchType.LAZY, mappedBy = "dmp")
|
|
// private Set<DMPDatasetProfile> associatedDmps;
|
|
|
|
// @ManyToOne(fetch = FetchType.LAZY)
|
|
// @JoinColumn(name = "\"Profile\"")
|
|
//TODO: (thgiannos) Previously 'DMPProfile'
|
|
private UUID profile;
|
|
|
|
// @ManyToOne(fetch = FetchType.LAZY)
|
|
// @JoinColumn(name = "\"Creator\"")
|
|
//TODO: (thgiannos) Previously 'UserInfo'
|
|
private UUID creator;
|
|
|
|
//TODO: (thgiannos) Handle using the DMPEntity builder
|
|
// @OneToMany(mappedBy = "entityId", fetch = FetchType.LAZY)
|
|
// private Set<EntityDoiEntity> dois;
|
|
|
|
// @ManyToOne(fetch = FetchType.LAZY)
|
|
// @JoinColumn(name = "\"Project\"")
|
|
//TODO: (thgiannos) Previously 'Project'
|
|
private UUID project;
|
|
|
|
// TODO: (thgiannos) Implement join entity
|
|
// @OneToMany(fetch = FetchType.LAZY)
|
|
// @JoinTable(name = "\"DMPOrganisation\"",
|
|
// joinColumns = {@JoinColumn(name = "\"DMP\"", referencedColumnName = "\"ID\"")},
|
|
// inverseJoinColumns = {@JoinColumn(name = "\"Organisation\"", referencedColumnName = "\"ID\"")}
|
|
// )
|
|
// private Set<Organisation> organisations;
|
|
|
|
// TODO: (thgiannos) Implement join entity
|
|
// @OneToMany(fetch = FetchType.LAZY)
|
|
// @JoinTable(name = "\"DMPResearcher\"",
|
|
// joinColumns = {@JoinColumn(name = "\"DMP\"", referencedColumnName = "\"ID\"")},
|
|
// inverseJoinColumns = {@JoinColumn(name = "\"Researcher\"", referencedColumnName = "\"ID\"")}
|
|
// )
|
|
// private Set<Researcher> researchers;
|
|
|
|
//TODO: (thgiannos) Handle using the DMPEntity builder
|
|
// private Set<UserDMP> users;
|
|
|
|
// @Column(name = "\"FinalizedAt\"")
|
|
// @Convert(converter = DateToUTCConverter.class)
|
|
// private Date finalizedAt;
|
|
//
|
|
// @Column(name = "\"PublishedAt\"")
|
|
// @Convert(converter = DateToUTCConverter.class)
|
|
// private Date publishedAt;
|
|
|
|
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 Integer getVersion() {
|
|
return version;
|
|
}
|
|
|
|
public void setVersion(Integer version) {
|
|
this.version = version;
|
|
}
|
|
|
|
public DMPStatus getStatus() {
|
|
return status;
|
|
}
|
|
|
|
public void setStatus(DMPStatus status) {
|
|
this.status = status;
|
|
}
|
|
|
|
public String getProperties() {
|
|
return properties;
|
|
}
|
|
|
|
public void setProperties(String properties) {
|
|
this.properties = properties;
|
|
}
|
|
|
|
public String getDmpProperties() {
|
|
return dmpProperties;
|
|
}
|
|
|
|
public void setDmpProperties(String dmpProperties) {
|
|
this.dmpProperties = dmpProperties;
|
|
}
|
|
|
|
public UUID getGroupId() {
|
|
return groupId;
|
|
}
|
|
|
|
public void setGroupId(UUID groupId) {
|
|
this.groupId = groupId;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
public boolean getPublic() {
|
|
return isPublic;
|
|
}
|
|
|
|
public void setPublic(boolean aPublic) {
|
|
isPublic = aPublic;
|
|
}
|
|
|
|
public String getExtraProperties() {
|
|
return extraProperties;
|
|
}
|
|
|
|
public void setExtraProperties(String extraProperties) {
|
|
this.extraProperties = extraProperties;
|
|
}
|
|
|
|
public Instant getCreatedAt() {
|
|
return createdAt;
|
|
}
|
|
|
|
public void setCreatedAt(Instant createdAt) {
|
|
this.createdAt = createdAt;
|
|
}
|
|
|
|
public Instant getUpdatedAt() {
|
|
return updatedAt;
|
|
}
|
|
|
|
public void setUpdatedAt(Instant updatedAt) {
|
|
this.updatedAt = updatedAt;
|
|
}
|
|
|
|
public IsActive getIsActive() {
|
|
return isActive;
|
|
}
|
|
|
|
public void setIsActive(IsActive isActive) {
|
|
this.isActive = isActive;
|
|
}
|
|
|
|
public UUID getGrant() {
|
|
return grant;
|
|
}
|
|
|
|
public void setGrant(UUID grant) {
|
|
this.grant = grant;
|
|
}
|
|
|
|
public UUID getProfile() {
|
|
return profile;
|
|
}
|
|
|
|
public void setProfile(UUID profile) {
|
|
this.profile = profile;
|
|
}
|
|
|
|
public UUID getCreator() {
|
|
return creator;
|
|
}
|
|
|
|
public void setCreator(UUID creator) {
|
|
this.creator = creator;
|
|
}
|
|
|
|
public UUID getProject() {
|
|
return project;
|
|
}
|
|
|
|
public void setProject(UUID project) {
|
|
this.project = project;
|
|
}
|
|
|
|
}
|