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 2013/05/13 17:33:23 UTC

svn commit: r1481926 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/query/XPathToSQL2Converter.java test/resources/org/apache/jackrabbit/oak/query/xpath.txt

Author: thomasm
Date: Mon May 13 15:33:23 2013
New Revision: 1481926

URL: http://svn.apache.org/r1481926
Log:
OAK-28 Query implementation / XPath: support identifiers with embedded dots

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/XPathToSQL2Converter.java
    jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/xpath.txt

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/XPathToSQL2Converter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/XPathToSQL2Converter.java?rev=1481926&r1=1481925&r2=1481926&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/XPathToSQL2Converter.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/XPathToSQL2Converter.java Mon May 13 15:33:23 2013
@@ -837,7 +837,11 @@ public class XPathToSQL2Converter {
                 type = types[i];
                 // the '-' can be part of a name,
                 // for example in "fn:lower-case"
-                if (type != CHAR_NAME && type != CHAR_VALUE && chars[i] != '-') {
+                // the '.' can be part of a name,
+                // for example in "@offloading.status"
+                if (type != CHAR_NAME && type != CHAR_VALUE 
+                        && chars[i] != '-'
+                        && chars[i] != '.') {
                     break;
                 }
                 i++;

Modified: jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/xpath.txt
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/xpath.txt?rev=1481926&r1=1481925&r2=1481926&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/xpath.txt (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/xpath.txt Mon May 13 15:33:23 2013
@@ -34,6 +34,9 @@ select [jcr:path], [jcr:score], * from [
 xpath2sql testroot//child[@foo1]
 select [jcr:path], [jcr:score], * from [nt:base] as a where [foo1] is not null and name(a) = 'child' and isdescendantnode(a, '/testroot') /* xpath: testroot//child[@foo1] */
 
+xpath2sql test.root//ch.ild[@fo.o1]
+select [jcr:path], [jcr:score], * from [nt:base] as a where [fo.o1] is not null and name(a) = 'ch.ild' and isdescendantnode(a, '/test.root') /* xpath: test.root//ch.ild[@fo.o1] */
+
 xpath2sql /jcr:root/testroot/node11
 select [jcr:path], [jcr:score], * from [nt:base] as a where issamenode(a, '/testroot/node11') /* xpath: /jcr:root/testroot/node11 */