tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1099664 - /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngine.java
Date Thu, 05 May 2011 02:10:23 GMT
Author: xuhaihong
Date: Thu May  5 02:10:23 2011
New Revision: 1099664

URL: http://svn.apache.org/viewvc?rev=1099664&view=rev
Log:
OPENEJB-1539 IllegalArgumentException when input parameters for select is more than input
parameters in EJB QL query (Patch from Han Hong Fang)

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngine.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngine.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngine.java?rev=1099664&r1=1099663&r2=1099664&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngine.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngine.java
Thu May  5 02:10:23 2011
@@ -262,6 +262,13 @@ public class JpaCmpEngine implements Cmp
             if (arg instanceof EJBLocalObject) {
                 arg = Cmp2Util.getEntityBean(((EJBLocalObject) arg));
             }
+            try {
+                query.getParameter(i + 1);
+            } catch (IllegalArgumentException e) {
+                // IllegalArgumentException means that the parameter with the
+                // specified position does not exist
+                continue;
+            }
             query.setParameter(i + 1, arg);
         }
 



Mime
View raw message