From beb334f2fa2e21c508b86aac0f3ae54fb160fa12 Mon Sep 17 00:00:00 2001 From: T-Midnight Date: Sat, 4 May 2019 23:59:03 +0400 Subject: [PATCH] #32 add variable "events" --- src/main/java/ru/ulstu/grant/model/Grant.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/ru/ulstu/grant/model/Grant.java b/src/main/java/ru/ulstu/grant/model/Grant.java index d6f9f0c..ac8ac19 100644 --- a/src/main/java/ru/ulstu/grant/model/Grant.java +++ b/src/main/java/ru/ulstu/grant/model/Grant.java @@ -9,6 +9,7 @@ import ru.ulstu.deadline.model.Deadline; import ru.ulstu.file.model.FileData; import ru.ulstu.paper.model.Paper; import ru.ulstu.project.model.Project; +import ru.ulstu.timeline.model.Event; import ru.ulstu.user.model.User; import javax.persistence.CascadeType; @@ -92,6 +93,10 @@ public class Grant extends BaseEntity implements UserContainer { inverseJoinColumns = {@JoinColumn(name = "paper_id")}) private List papers = new ArrayList<>(); + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "grant_id") + private List events = new ArrayList<>(); + public GrantStatus getStatus() { return status; } @@ -169,6 +174,14 @@ public class Grant extends BaseEntity implements UserContainer { this.papers = papers; } + public List getEvents() { + return events; + } + + public void setEvents(List events) { + this.events = events; + } + public Optional getNextDeadline() { return deadlines .stream()