From edc9c7c090169ab69a54cb28e746d5e1ff5e3257 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Sun, 30 Dec 2018 19:22:51 +0400 Subject: [PATCH] sort deadlines --- src/main/java/ru/ulstu/paper/model/Paper.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/ru/ulstu/paper/model/Paper.java b/src/main/java/ru/ulstu/paper/model/Paper.java index e44912f..ed55e98 100644 --- a/src/main/java/ru/ulstu/paper/model/Paper.java +++ b/src/main/java/ru/ulstu/paper/model/Paper.java @@ -19,6 +19,7 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; +import javax.persistence.OrderBy; import javax.persistence.Temporal; import javax.persistence.TemporalType; import java.util.ArrayList; @@ -69,6 +70,7 @@ public class Paper extends BaseEntity implements UserContainer { @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) @JoinColumn(name = "paper_id", unique = true) @Fetch(FetchMode.SUBSELECT) + @OrderBy("date") private List deadlines = new ArrayList<>(); private String comment;