From: xg353y Date: Mon, 13 May 2019 10:44:56 +0000 (+0200) Subject: Update the order of the loop log X-Git-Tag: 4.0.2~6 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=clamp.git;a=commitdiff_plain;h=5a03836ae696fb3377d6086e923650e2a96aebd0 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 --- diff --git a/src/main/java/org/onap/clamp/loop/Loop.java b/src/main/java/org/onap/clamp/loop/Loop.java index 0041c589..f47a6a08 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() {