sort deadlines

This commit is contained in:
Anton Romanov 2018-12-30 19:22:51 +04:00
parent 2cac98be50
commit edc9c7c090

View File

@ -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<Deadline> deadlines = new ArrayList<>();
private String comment;