You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@griffin.apache.org by gu...@apache.org on 2019/08/22 23:24:42 UTC

[griffin] branch master updated: [GRIFFIN-266] Task : add sorting to EvaluateRule

This is an automated email from the ASF dual-hosted git repository.

guoyp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/griffin.git


The following commit(s) were added to refs/heads/master by this push:
     new 166f518  [GRIFFIN-266] Task : add sorting to EvaluateRule
166f518 is described below

commit 166f518bef47ab4fc554ac1310d5d599a0c18b3b
Author: neveljkovic <nv...@plume.com>
AuthorDate: Fri Aug 23 07:24:25 2019 +0800

    [GRIFFIN-266] Task : add sorting to EvaluateRule
    
    This is how we fixed postgres order by issue described in https://issues.apache.org/jira/browse/GRIFFIN-266
    Solution is deployed to our servers and works OK.
    
    Author: neveljkovic <nv...@plume.com>
    
    Closes #525 from neveljkovic/griffin-266.
---
 .../main/java/org/apache/griffin/core/measure/entity/EvaluateRule.java  | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/service/src/main/java/org/apache/griffin/core/measure/entity/EvaluateRule.java b/service/src/main/java/org/apache/griffin/core/measure/entity/EvaluateRule.java
index 3107852..1a9c452 100644
--- a/service/src/main/java/org/apache/griffin/core/measure/entity/EvaluateRule.java
+++ b/service/src/main/java/org/apache/griffin/core/measure/entity/EvaluateRule.java
@@ -27,6 +27,7 @@ import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.JoinColumn;
 import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
 
 
 @Entity
@@ -36,6 +37,7 @@ public class EvaluateRule extends AbstractAuditableEntity {
     @OneToMany(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST,
         CascadeType.REMOVE, CascadeType.MERGE})
     @JoinColumn(name = "evaluate_rule_id")
+    @OrderBy("id ASC")
     private List<Rule> rules = new ArrayList<>();
 
     public List<Rule> getRules() {