openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r653595 - in /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel: exps/QueryExpressions.java jpql/JPQLExpressionBuilder.java
Date Mon, 05 May 2008 20:52:29 GMT
Author: mikedd
Date: Mon May  5 13:52:29 2008
New Revision: 653595

URL: http://svn.apache.org/viewvc?rev=653595&view=rev
Log:
OPENJPA-590 committing patch provided by Fay Wang

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/QueryExpressions.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/QueryExpressions.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/QueryExpressions.java?rev=653595&r1=653594&r2=653595&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/QueryExpressions.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/QueryExpressions.java
Mon May  5 13:52:29 2008
@@ -21,6 +21,7 @@
 import java.io.Serializable;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
 import org.apache.commons.collections.map.LinkedMap;
@@ -47,7 +48,7 @@
     /**
      * Map of {@link FieldMetaData},{@link Value} for update statements.
      */
-    public Map updates = Collections.EMPTY_MAP;
+    public Map<Path, Value> updates = Collections.EMPTY_MAP;
     public int distinct = DISTINCT_AUTO;
     public String alias = null;
     public Value[] projections = EMPTY_VALUES;
@@ -86,7 +87,7 @@
      */
     public void putUpdate(Path path, Value val) {
         if (updates == Collections.EMPTY_MAP)
-            updates = new HashMap();
+            updates = new LinkedHashMap<Path, Value>();
         updates.put(path, val);
     }
 

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java?rev=653595&r1=653594&r2=653595&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
Mon May  5 13:52:29 2008
@@ -26,6 +26,7 @@
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.LinkedHashSet;
 import java.util.Set;
 import java.util.Stack;
 import java.util.TreeSet;
@@ -1569,12 +1570,12 @@
         }
 
         JPQLNode[] findChildrenByID(int id) {
-            Collection set = new HashSet();
+            Collection<JPQLNode> set = new LinkedHashSet<JPQLNode>();
             findChildrenByID(id, set);
-            return (JPQLNode[]) set.toArray(new JPQLNode[set.size()]);
+            return set.toArray(new JPQLNode[set.size()]);
         }
 
-        private void findChildrenByID(int id, Collection set) {
+        private void findChildrenByID(int id, Collection<JPQLNode> set) {
             for (int i = 0; children != null && i < children.length; i++) {
                 if (children[i].id == id)
                     set.add(children[i]);



Mime
View raw message