Daglian, Michael (IT) wrote:
I was wondering what the proper syntax is for executing or statements
within an xpath query. According to the spec something like the
following should be possible (although totally contrived in this case):
//element(*, nt:file) or //element(*, mix:lockable)
from a pure syntactic standpoint this allowed by the spec. however there
are a number of constraints that also apply to a query in order to make
it mappable to SQL. One of these constraints is that only one path
expression must be supported. the union of two path expression like the
one above is not supported by jackrabbit.
there are discussions in the expert group of jsr-283 on extended query
features that should become mandatory in JCR 2.0. Supporting the union
operator is IMO an extension that definitively makes sense.
But more about this topic on a separate email thread...
However, this throws a ClassCastException in the XPathQueryBuilder on
line 322 (it appears that in the invocation of the visit method the
SimpleNode id indicates a type of JJTROOTDESCENDANTS at a certain point
but the data is actually an OrQueryNode and hence the cast to a
PathQueryNode fails). I am using the 0.9 release currently.
This is certainly a bug in the query builder. could you please file a
jira issue? Thanks.
regards
marcel