257 lines
5.5 KiB
Java
257 lines
5.5 KiB
Java
package eu.eudat.migration.entities;
|
|
|
|
import org.hibernate.annotations.LazyCollection;
|
|
import org.hibernate.annotations.LazyCollectionOption;
|
|
|
|
import javax.persistence.*;
|
|
import java.util.*;
|
|
|
|
@Entity
|
|
@Table(name = "plans")
|
|
public class Plan {
|
|
|
|
@Id
|
|
private Long id;
|
|
private String title;
|
|
@Column(name = "created_at")
|
|
@Temporal(TemporalType.TIMESTAMP)
|
|
private Date createdAt;
|
|
@Column(name = "updated_at")
|
|
@Temporal(TemporalType.TIMESTAMP)
|
|
private Date updatedAt;
|
|
private String identifier;
|
|
private String description;
|
|
private Visibility visibility;
|
|
@Column(name = "feedback_requested")
|
|
private Boolean feedbackRequested;
|
|
private Boolean complete;
|
|
@ManyToOne(fetch = FetchType.EAGER)
|
|
@JoinColumn(name = "org_id")
|
|
private Organization organization;
|
|
@ManyToOne(fetch = FetchType.EAGER)
|
|
@JoinColumn(name = "funder_id")
|
|
private Organization funder;
|
|
@Column(name = "start_date")
|
|
@Temporal(TemporalType.TIMESTAMP)
|
|
private Date startDate;
|
|
@Column(name = "end_date")
|
|
@Temporal(TemporalType.TIMESTAMP)
|
|
private Date endDate;
|
|
@Column(name = "grant_id")
|
|
private Long grantId;
|
|
@ManyToOne(fetch = FetchType.EAGER)
|
|
@JoinColumn(name = "api_client_id")
|
|
private ApiClient apiClient;
|
|
@ManyToOne(fetch = FetchType.EAGER)
|
|
@JoinColumn(name = "research_domain_id")
|
|
private ResearchDomain researchDomain;
|
|
@Column(name = "ethical_issues")
|
|
private Boolean ethicalIssues;
|
|
@Column(name = "ethical_issues_description")
|
|
private String ethicalIssuesDescription;
|
|
@Column(name = "ethical_issues_report")
|
|
private String ethicalIssuesReport;
|
|
@Column(name = "funding_status")
|
|
private FundingStatus fundingStatus;
|
|
@ManyToMany(cascade = CascadeType.ALL)
|
|
@JoinTable(name = "roles",
|
|
joinColumns = {@JoinColumn(name = "plan_id")},
|
|
inverseJoinColumns = {@JoinColumn(name = "user_id")}
|
|
)
|
|
@LazyCollection(LazyCollectionOption.FALSE)
|
|
private Set<User> users = new HashSet<>();
|
|
@OneToMany(cascade = CascadeType.ALL)
|
|
@JoinColumn(name = "plan_id")
|
|
@LazyCollection(LazyCollectionOption.FALSE)
|
|
private Set<Answer> answers = new HashSet<>();
|
|
|
|
public enum Visibility {
|
|
ORGANIZATION,
|
|
PUBLIC,
|
|
TEST,
|
|
PRIVATE
|
|
}
|
|
|
|
public enum FundingStatus {
|
|
PLANNED,
|
|
FUNDED,
|
|
DENIED
|
|
}
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getTitle() {
|
|
return title;
|
|
}
|
|
|
|
public void setTitle(String title) {
|
|
this.title = title;
|
|
}
|
|
|
|
public Date getCreatedAt() {
|
|
return createdAt;
|
|
}
|
|
|
|
public void setCreatedAt(Date createdAt) {
|
|
this.createdAt = createdAt;
|
|
}
|
|
|
|
public Date getUpdatedAt() {
|
|
return updatedAt;
|
|
}
|
|
|
|
public void setUpdatedAt(Date updatedAt) {
|
|
this.updatedAt = updatedAt;
|
|
}
|
|
|
|
public String getIdentifier() {
|
|
return identifier;
|
|
}
|
|
|
|
public void setIdentifier(String identifier) {
|
|
this.identifier = identifier;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
public Visibility getVisibility() {
|
|
return visibility;
|
|
}
|
|
|
|
public void setVisibility(Visibility visibility) {
|
|
this.visibility = visibility;
|
|
}
|
|
|
|
public Boolean getFeedbackRequested() {
|
|
return feedbackRequested;
|
|
}
|
|
|
|
public void setFeedbackRequested(Boolean feedbackRequested) {
|
|
this.feedbackRequested = feedbackRequested;
|
|
}
|
|
|
|
public Boolean getComplete() {
|
|
return complete;
|
|
}
|
|
|
|
public void setComplete(Boolean complete) {
|
|
this.complete = complete;
|
|
}
|
|
|
|
public Organization getOrganization() {
|
|
return organization;
|
|
}
|
|
|
|
public void setOrganization(Organization organization) {
|
|
this.organization = organization;
|
|
}
|
|
|
|
public Organization getFunder() {
|
|
return funder;
|
|
}
|
|
|
|
public void setFunder(Organization funder) {
|
|
this.funder = funder;
|
|
}
|
|
|
|
public Date getStartDate() {
|
|
return startDate;
|
|
}
|
|
|
|
public void setStartDate(Date startDate) {
|
|
this.startDate = startDate;
|
|
}
|
|
|
|
public Date getEndDate() {
|
|
return endDate;
|
|
}
|
|
|
|
public void setEndDate(Date endDate) {
|
|
this.endDate = endDate;
|
|
}
|
|
|
|
public Long getGrantId() {
|
|
return grantId;
|
|
}
|
|
|
|
public void setGrantId(Long grantId) {
|
|
this.grantId = grantId;
|
|
}
|
|
|
|
public ApiClient getApiClient() {
|
|
return apiClient;
|
|
}
|
|
|
|
public void setApiClient(ApiClient apiClient) {
|
|
this.apiClient = apiClient;
|
|
}
|
|
|
|
public ResearchDomain getResearchDomain() {
|
|
return researchDomain;
|
|
}
|
|
|
|
public void setResearchDomain(ResearchDomain researchDomain) {
|
|
this.researchDomain = researchDomain;
|
|
}
|
|
|
|
public Boolean getEthicalIssues() {
|
|
return ethicalIssues;
|
|
}
|
|
|
|
public void setEthicalIssues(Boolean ethicalIssues) {
|
|
this.ethicalIssues = ethicalIssues;
|
|
}
|
|
|
|
public String getEthicalIssuesDescription() {
|
|
return ethicalIssuesDescription;
|
|
}
|
|
|
|
public void setEthicalIssuesDescription(String ethicalIssuesDescription) {
|
|
this.ethicalIssuesDescription = ethicalIssuesDescription;
|
|
}
|
|
|
|
public String getEthicalIssuesReport() {
|
|
return ethicalIssuesReport;
|
|
}
|
|
|
|
public void setEthicalIssuesReport(String ethicalIssuesReport) {
|
|
this.ethicalIssuesReport = ethicalIssuesReport;
|
|
}
|
|
|
|
public FundingStatus getFundingStatus() {
|
|
return fundingStatus;
|
|
}
|
|
|
|
public void setFundingStatus(FundingStatus fundingStatus) {
|
|
this.fundingStatus = fundingStatus;
|
|
}
|
|
|
|
public Set<User> getUsers() {
|
|
return users;
|
|
}
|
|
|
|
public void setUsers(Set<User> users) {
|
|
this.users = users;
|
|
}
|
|
|
|
public Set<Answer> getAnswers() {
|
|
return answers;
|
|
}
|
|
|
|
public void setAnswers(Set<Answer> answers) {
|
|
this.answers = answers;
|
|
}
|
|
}
|