openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mprud...@apache.org
Subject svn commit: r485967 - /incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
Date Tue, 12 Dec 2006 00:40:23 GMT
Author: mprudhom
Date: Mon Dec 11 16:40:22 2006
New Revision: 485967

URL: http://svn.apache.org/viewvc?view=rev&rev=485967
Log:
Allow the parameter to an IN(?) expression to be a Collection type, which allows variable-length
IN parameters. The spec is a little vague about whether this should be allowed or not, but
there's no reason not to support it.

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

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java?view=diff&rev=485967&r1=485966&r2=485967
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
Mon Dec 11 16:40:22 2006
@@ -822,8 +822,9 @@
                 while (inIterator.hasNext()) {
                     val2 = getValue((JPQLNode) inIterator.next());
 
-                    // special case for <value> IN (<subquery>)
-                    if (val2 instanceof Subquery && node.getChildCount() == 2)
+                    // special case for <value> IN (<subquery>) or
+                    // <value> IN (<single value>)
+                    if (!(val2 instanceof Literal) && node.getChildCount() == 2)
                         return factory.contains(val2, val1); 
 
                     // this is currently a sequence of OR expressions, since we



Mime
View raw message