db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1098697 - /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SqlExpression.java
Date Mon, 02 May 2011 18:06:19 GMT
Author: tfischer
Date: Mon May  2 18:06:19 2011
New Revision: 1098697

URL: http://svn.apache.org/viewvc?rev=1098697&view=rev
Log:
enable subqueries

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SqlExpression.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SqlExpression.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SqlExpression.java?rev=1098697&r1=1098696&r2=1098697&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SqlExpression.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SqlExpression.java
Mon May  2 18:06:19 2011
@@ -415,12 +415,6 @@ public final class SqlExpression
                 }
             }
         }
-        else if (parameter instanceof String)
-        {
-            // subquery
-            inClause.add((String) sqlValue);
-            params.add(parameter);
-        }
         else if (parameter.getClass().isArray())
         {
             for (Object listValue : (Object[]) parameter)
@@ -436,13 +430,20 @@ public final class SqlExpression
                 }
             }
         }
+        else if (!"?".equals(sqlValue))
+        {
+            // subquery
+            inClause.add((String) sqlValue);
+            params.add(parameter);
+        }
         else
         {
             throw new IllegalArgumentException(
                     "Unknown parameter type "
                     + parameter.getClass().getName()
                     + ". parameter must be an instance of "
-                    + " Iterable, String or Array");
+                    + " Iterable or Array"
+                    + " or sqlValue must contain a subquery");
         }
         whereClause.append('(')
                    .append(StringUtils.join(inClause.iterator(), ","))



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message