You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by th...@apache.org on 2014/01/08 14:54:54 UTC
svn commit: r1556532 -
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/xpath/Statement.java
Author: thomasm
Date: Wed Jan 8 13:54:54 2014
New Revision: 1556532
URL: http://svn.apache.org/r1556532
Log:
OAK-1215 Relative property paths don't work in XPath search expressions (WIP)
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/xpath/Statement.java
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/xpath/Statement.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/xpath/Statement.java?rev=1556532&r1=1556531&r2=1556532&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/xpath/Statement.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/xpath/Statement.java Wed Jan 8 13:54:54 2014
@@ -19,6 +19,7 @@ package org.apache.jackrabbit.oak.query.
import java.util.ArrayList;
import org.apache.jackrabbit.oak.query.QueryImpl;
+import org.apache.jackrabbit.oak.query.xpath.Expression.AndCondition;
import org.apache.jackrabbit.oak.query.xpath.Expression.OrCondition;
import org.apache.jackrabbit.oak.query.xpath.Expression.Property;
@@ -64,8 +65,10 @@ public class Statement {
// @x in (1, 2)
// within the query engine
} else {
+ // conditions of type
// @x = 1 or @y = 2
- // or similar
+ // or similar are converted to
+ // (@x = 1) union (@y = 2)
Statement s1 = new Statement();
s1.columnSelector = columnSelector;
s1.selectors = selectors;
@@ -79,6 +82,12 @@ public class Statement {
s2.xpathQuery = xpathQuery;
return new UnionStatement(s1, s2);
}
+ } else if (where instanceof AndCondition) {
+ // TODO
+ // conditions of type
+ // @a = 1 and (@x = 1 or @y = 2)
+ // could be automatically converted to
+ // (@a = 1 and @x = 1) union (@a = 1 and @y = 2)
}
return this;
}