cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkazimirc...@apache.org
Subject svn commit: r1143061 - in /cayenne/main/trunk: docs/doc/src/main/resources/RELEASE-NOTES.txt framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
Date Tue, 05 Jul 2011 13:53:01 GMT
Author: dkazimirchyk
Date: Tue Jul  5 13:53:01 2011
New Revision: 1143061

URL: http://svn.apache.org/viewvc?rev=1143061&view=rev
Log:
CAY-1584 Improve Cayenne modeler re-ordering named query in the cayenne map xml

added sorting before writing to xml

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=1143061&r1=1143060&r2=1143061&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Tue Jul  5 13:53:01 2011
@@ -22,6 +22,7 @@ CAY-1545 cayenne-lifecycle Referenceable
 CAY-1547 cayenne-lifecycle: support for setting UuidRelationships
 CAY-1549 Migrate BatchQueryBuilderFactory to DI
 CAY-1553 cayenne-lifecycle: @SortWeight annotation 
+CAY-1584 Improve Cayenne modeler re-ordering named query in the cayenne map xml
 
 Bug Fixes Since 3.1M2:
 
@@ -118,8 +119,11 @@ CAY-1430 Problems with TINYINT type mapp
 Release: 3.0.3
 Date: 
 ----------------------------------
+Changes/New Features Since 3.0.2:
 
-Bug Fixes Since 3.0.2
+CAY-1584 Improve Cayenne modeler re-ordering named query in the cayenne map xml
+
+Bug Fixes Since 3.0.2:
 
 CAY-1577 SQL queries for LIKE expressions with escape character generated with syntax errors
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java?rev=1143061&r1=1143060&r2=1143061&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
Tue Jul  5 13:53:01 2011
@@ -24,6 +24,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.TreeSet;
 
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbEntity;
@@ -236,9 +237,11 @@ public class SQLTemplate extends Abstrac
 
         // encode adapter SQL
         if (templates != null && !templates.isEmpty()) {
-            for (Map.Entry<String, String> entry : templates.entrySet()) {
-                String key = entry.getKey();
-                String value = entry.getValue();
+            
+            //sorting entries by adapter name
+            TreeSet<String> keys = new TreeSet<String>(templates.keySet());
+            for (String key : keys) {
+                String value = templates.get(key);
 
                 if (key != null && value != null) {
                     String sql = value.trim();



Mime
View raw message