From 5a03836ae696fb3377d6086e923650e2a96aebd0 Mon Sep 17 00:00:00 2001 From: xg353y Date: Mon, 13 May 2019 12:44:56 +0200 Subject: Update the order of the loop log Update the order of the loop log, so that the latest log will be shown on the top. Issue-ID: CLAMP-383 Change-Id: I8d377f923f2bdd80deb5db1828f36cc4adc76a9f Signed-off-by: xg353y --- src/main/java/org/onap/clamp/loop/Loop.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main') diff --git a/src/main/java/org/onap/clamp/loop/Loop.java b/src/main/java/org/onap/clamp/loop/Loop.java index 0041c589e..f47a6a08c 100644 --- a/src/main/java/org/onap/clamp/loop/Loop.java +++ b/src/main/java/org/onap/clamp/loop/Loop.java @@ -45,6 +45,7 @@ import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.OneToMany; +import javax.persistence.OrderBy; import javax.persistence.Table; import org.hibernate.annotations.Type; @@ -114,6 +115,7 @@ public class Loop implements Serializable { @Expose @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "loop") + @OrderBy("log_instant DESC") private Set loopLogs = new HashSet<>(); public Loop() { -- cgit 1.2.3-korg