jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r485577 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
Date Mon, 11 Dec 2006 09:28:19 GMT
Author: mreutegg
Date: Mon Dec 11 01:28:18 2006
New Revision: 485577

URL: http://svn.apache.org/viewvc?view=rev&rev=485577
Log:
JCR-668: Allow pseudo properties in query relation

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java?view=diff&rev=485577&r1=485576&r2=485577
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
Mon Dec 11 01:28:18 2006
@@ -923,6 +923,17 @@
                 } else {
                     exceptions.add(new InvalidQueryException("Unsupported location for fn:upper-case()"));
                 }
+            } else if (queryNode.getType() == QueryNode.TYPE_RELATION) {
+                // use function name as name of a pseudo property in a relation
+                try {
+                    QName name = NameFormat.parse(fName + "()", resolver);
+                    RelationQueryNode relNode = (RelationQueryNode) queryNode;
+                    relNode.setRelativePath(Path.create(name, 0));
+                } catch (IllegalNameException e) {
+                    exceptions.add(e);
+                } catch (UnknownPrefixException e) {
+                    exceptions.add(e);
+                }
             } else {
                 exceptions.add(new InvalidQueryException("Unsupported function: " + fName));
             }



Mime
View raw message