Hi all,
in the process of migrating my code based on jackrabbit 2.x to oak I've just
found that jcr:deref is not supported by oak, for a query like this:
/jcr:root/tempQueries/fe8396aa-f179-40e8-b68a-b67f13ae7752/jcr:deref(@reference,
'*')
I get this stacktrace:
2024.06.19 14:50:43.076 - *DEBUG* [Searcher-admin-INTERNAL_SEARCH_ID]
o.a.j.oak.query.QueryEngineImpl: Parsing xpath statement:
/jcr:root/tempQueries/fe8396aa-f179-40e8-b68a-b67f13ae7752/jcr:deref(@reference,
'*') (parseQuery in QueryEngineImpl.java, line 156)
2024.06.19 14:54:29.756 - *ERROR* [Searcher-admin-INTERNAL_SEARCH_ID]
i.c.w.c.searches.SearcherWriterImpl: Error while performing search. (run in
SearcherWriterImpl.java, line 495)
java.text.ParseException: Query:
/jcr:root/tempQueries/fe8396aa-f179-40e8-b68a-b67f13ae7752/jcr:deref(@(*)reference,
'*')
at
org.apache.jackrabbit.oak.query.xpath.XPathToSQL2Converter.getSyntaxError(XPathToSQL2Converter.java:1222)
at
org.apache.jackrabbit.oak.query.xpath.XPathToSQL2Converter.getSyntaxError(XPathToSQL2Converter.java:1203)
at
org.apache.jackrabbit.oak.query.xpath.XPathToSQL2Converter.convertToStatement(XPathToSQL2Converter.java:270)
at
org.apache.jackrabbit.oak.query.xpath.XPathToSQL2Converter.convert(XPathToSQL2Converter.java:99)
at
org.apache.jackrabbit.oak.query.QueryEngineImpl.parseQuery(QueryEngineImpl.java:194)
at
org.apache.jackrabbit.oak.query.QueryEngineImpl.executeQuery(QueryEngineImpl.java:267)
at
org.apache.jackrabbit.oak.jcr.query.QueryManagerImpl.executeQuery(QueryManagerImpl.java:137)
... 10 common frames omitted
I've seen that in XPathToSQL2Converter class there is this section:
else if ("jcr:deref".equals(functionName)) {
// TODO maybe support jcr:deref
throw getSyntaxError("jcr:deref is not supported");
}
nevertheless, my query never reaches that point, the exception is thrown before
as you can see in the stacktrace, besides that I've found this very old issue
https://issues.apache.org/jira/browse/OAK-321
In jackrabbit 2.x I was able to do that query, do you think derf will be
supported in next oak releases?
If it is confirmed that jcr:deref is not supported, I think that should be
documented because if one have to think about migration from jackrabbit 2.x,
like me, knowing this may totally change plans.
Thank you
Cordiali saluti / Best regards,
Raffaele Gambelli
Senior Java Developer
E [email protected]<mailto:[email protected]>
[CEGEKA] Via Ettore Cristoni, 84
IT-40033 Bologna (IT), Italy
T +39 02 2544271
WWW.CEGEKA.COM<https://www.cegeka.com>
[http://signature.cegeka.com/SignatureRO/bannerRO.jpg]