Update the order of the loop log 37/87537/6
authorxg353y <xg353y@intl.att.com>
Mon, 13 May 2019 10:44:56 +0000 (12:44 +0200)
committerxg353y <xg353y@intl.att.com>
Mon, 13 May 2019 12:27:58 +0000 (14:27 +0200)
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 <xg353y@intl.att.com>
src/main/java/org/onap/clamp/loop/Loop.java

index 0041c58..f47a6a0 100644 (file)
@@ -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<LoopLog> loopLogs = new HashSet<>();
 
     public Loop() {