jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r570098 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
Date Mon, 27 Aug 2007 13:01:39 GMT
Author: mreutegg
Date: Mon Aug 27 06:01:39 2007
New Revision: 570098

URL: http://svn.apache.org/viewvc?rev=570098&view=rev
Log:
JCR-1090: Superfluous AndQueryNode in query tree built by SQL parser

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java?rev=570098&r1=570097&r2=570098&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
Mon Aug 27 06:01:39 2007
@@ -255,7 +255,11 @@
             }
         }
 
-        if (constraintNode.getNumOperands() > 0) {
+        if (constraintNode.getNumOperands() == 1) {
+            // attach operand to last path step
+            LocationStepQueryNode[] steps = pathNode.getPathSteps();
+            steps[steps.length - 1].addPredicate(constraintNode.getOperands()[0]);
+        } else if (constraintNode.getNumOperands() > 1) {
             // attach constraint to last path step
             LocationStepQueryNode[] steps = pathNode.getPathSteps();
             steps[steps.length - 1].addPredicate(constraintNode);



Mime
View raw message