#101 project model edited

This commit is contained in:
Васин Антон 2019-05-07 14:00:24 +03:00
parent b1e101c940
commit 279cc0e18a

View File

@ -5,11 +5,13 @@ import ru.ulstu.core.model.BaseEntity;
import ru.ulstu.deadline.model.Deadline;
import ru.ulstu.file.model.FileData;
import ru.ulstu.grant.model.Grant;
import ru.ulstu.timeline.model.Event;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
@ -62,6 +64,10 @@ public class Project extends BaseEntity {
@JoinColumn(name = "file_id")
private FileData application;
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "project_id")
private List<Event> events = new ArrayList<>();
public String getTitle() {
return title;
}
@ -117,4 +123,12 @@ public class Project extends BaseEntity {
public void setApplication(FileData application) {
this.application = application;
}
public List<Event> getEvents() {
return events;
}
public void setEvents(List<Event> events) {
this.events = events;
}
}