jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frédéric Esnault <f...@legisway.com>
Subject jcr:deref() in predicate
Date Fri, 22 Jun 2007 08:00:56 GMT
Hi all !


I'm facing a strange situation. I'm wondering if I'm doing something wrong or if it's a jackrabbit


I tried this search : /jcr:root/lgw:root/lgw:contracts/element(*, lgw:contractType)[jcr:deref(@lgw:internalContractor,
'lgw:contractorType')/@lgw:companyName = 'Lycos']


(I use element() because I'm testing not same name siblings performances).


The problem is that this query raises an exception :

InvalidQueryException: Unsupported location for jcr:deref()at 

at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:459)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:80)



In fact the error is raised in createFunction when testing the JCR_DEREF function. It fails
because it accepts either a 

QueryNode.TYPE_LOCATION or a QueryNode.TYPE_PATH queryNode type, or raises the InvalidQueryException.


The problem is that my queryNode, which is a RelationQueryNode, has a type set to 0, and 0
is not a valid type (I checked the constants defined in 

QueryNode abstract class). I saw the contructor in RelationQueryNode with no type creation,
but what's the meaning of this?


Is it forbidden to put a jcr:deref in a predicate, knowing that we can use child nodes and


Frederic Esnault

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message