openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jrba...@apache.org
Subject svn commit: r763958 - in /openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence: OpenJPAQuery.java QueryImpl.java QueryResultCacheImpl.java
Date Fri, 10 Apr 2009 15:04:47 GMT
Author: jrbauer
Date: Fri Apr 10 15:04:47 2009
New Revision: 763958

URL: http://svn.apache.org/viewvc?rev=763958&view=rev
Log:
OPENJPA-1032 Reverting back to 1.x OpenJPAQuery.getPositionalParameters signature due to spec
update.

Modified:
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAQuery.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryResultCacheImpl.java

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAQuery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAQuery.java?rev=763958&r1=763957&r2=763958&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAQuery.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAQuery.java
Fri Apr 10 15:04:47 2009
@@ -134,12 +134,10 @@
     public boolean hasPositionalParameters();
 
     /**
-     * The positional parameters for the query; empty list if none or
+     * The positional parameters for the query; empty array if none or
      * if query uses named parameters.
-     * Note: This method signature was changed in 2.0 to return a List
-     * instead of Object[] to match the JPA 2.0 spec.
      */
-    public List getPositionalParameters();
+    public Object[] getPositionalParameters();
 
     /**
      * The named parameters for the query; empty map if none or

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java?rev=763958&r1=763957&r2=763958&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java
Fri Apr 10 15:04:47 2009
@@ -74,7 +74,7 @@
  */
 public class QueryImpl implements OpenJPAQuerySPI, Serializable {
 
-    private static final List EMPTY_LIST = new ArrayList(0);
+    private static final Object[] EMPTY_ARRAY = new Object[0];
     private static final String SELECT = "SELECT ";
     private static final Localizer _loc = Localizer.forPackage(QueryImpl.class);
 
@@ -461,16 +461,16 @@
 	}
 
     /**
-     * Gets the list of positional parameter values. A value of
+     * Gets the array of positional parameter values. A value of
      * <code>GAP_FILLER</code> indicates that user has not set the
      * corresponding positional parameter. A value of null implies that user has
      * set the value as null.
      */
-    public List getPositionalParameters() {
+    public Object[] getPositionalParameters() {
         _query.lock();
         try {
-            return (_positional == null) ? EMPTY_LIST : 
-                    new ArrayList<Object>(_positional.values());
+            return (_positional == null) ? EMPTY_ARRAY : 
+                _positional.values().toArray();
         } finally {
             _query.unlock();
         }

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryResultCacheImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryResultCacheImpl.java?rev=763958&r1=763957&r2=763958&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryResultCacheImpl.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryResultCacheImpl.java
Fri Apr 10 15:04:47 2009
@@ -84,7 +84,7 @@
         QueryImpl impl = (QueryImpl) q;
         if (impl.hasPositionalParameters())
             return QueryKey.newInstance(impl.getDelegate(),
-                impl.getPositionalParameters().toArray());
+                impl.getPositionalParameters());
         return QueryKey.newInstance(impl.getDelegate(),
             impl.getNamedParameters());
     }



Mime
View raw message