202 lines
3.9 KiB
Java
202 lines
3.9 KiB
Java
package models.project;
|
|
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.Set;
|
|
import java.util.UUID;
|
|
|
|
import javax.persistence.Column;
|
|
import javax.persistence.FetchType;
|
|
import javax.persistence.GeneratedValue;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.JoinColumn;
|
|
import javax.persistence.ManyToOne;
|
|
import javax.persistence.OneToMany;
|
|
|
|
import org.hibernate.annotations.GenericGenerator;
|
|
import org.hibernate.annotations.Type;
|
|
|
|
import entities.DMP;
|
|
import entities.UserInfo;
|
|
import models.DataModel;
|
|
import models.dmp.DataManagementPlan;
|
|
|
|
public class Project implements DataModel<entities.Project>{
|
|
|
|
private UUID id;
|
|
|
|
private List<DataManagementPlan> dmps;
|
|
|
|
private String label;
|
|
|
|
private String abbreviation;
|
|
|
|
private String reference;
|
|
|
|
private String uri;
|
|
|
|
private String definition;
|
|
|
|
private Date startdate;
|
|
|
|
private Date enddate;
|
|
|
|
private Short status;
|
|
|
|
private UserInfo creationUser;
|
|
|
|
private Date created;
|
|
|
|
private Date modified;
|
|
|
|
private String description;
|
|
|
|
|
|
public UUID getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(UUID id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public List<DataManagementPlan> getDmps() {
|
|
return dmps;
|
|
}
|
|
|
|
public void setDmps(List<DataManagementPlan> dmps) {
|
|
this.dmps = dmps;
|
|
}
|
|
|
|
public String getLabel() {
|
|
return label;
|
|
}
|
|
|
|
public void setLabel(String label) {
|
|
this.label = label;
|
|
}
|
|
|
|
public String getAbbreviation() {
|
|
return abbreviation;
|
|
}
|
|
|
|
public void setAbbreviation(String abbreviation) {
|
|
this.abbreviation = abbreviation;
|
|
}
|
|
|
|
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 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 Short getStatus() {
|
|
return status;
|
|
}
|
|
|
|
public void setStatus(Short status) {
|
|
this.status = status;
|
|
}
|
|
|
|
public UserInfo getCreationUser() {
|
|
return creationUser;
|
|
}
|
|
|
|
public void setCreationUser(UserInfo creationUser) {
|
|
this.creationUser = creationUser;
|
|
}
|
|
|
|
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 String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
@Override
|
|
public void fromDataModel(entities.Project entity) throws InstantiationException, IllegalAccessException {
|
|
this.id = entity.getId();
|
|
this.label = entity.getLabel();
|
|
this.abbreviation = entity.getAbbreviation();
|
|
this.reference = entity.getReference();
|
|
this.uri = entity.getUri();
|
|
this.definition = entity.getDefinition();
|
|
this.startdate = entity.getStartdate();
|
|
this.enddate = entity.getEnddate();
|
|
this.status = entity.getStatus();
|
|
this.created = entity.getCreated();
|
|
this.modified = entity.getModified();
|
|
this.description = entity.getDescription();
|
|
|
|
}
|
|
|
|
@Override
|
|
public entities.Project toDataModel() {
|
|
entities.Project entity = new entities.Project();
|
|
entity.setId(this.id);
|
|
entity.setAbbreviation(this.abbreviation);
|
|
entity.setLabel(this.label);
|
|
entity.setReference(this.reference);
|
|
entity.setUri(this.uri);
|
|
entity.setDefinition(this.definition);
|
|
entity.setStartdate(this.startdate);
|
|
entity.setCreated(this.created == null? new Date():this.created);
|
|
entity.setEnddate(this.enddate);
|
|
entity.setStatus(this.status);
|
|
entity.setModified(new Date());
|
|
entity.setDescription(this.description);
|
|
return entity;
|
|
}
|
|
}
|