Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.4.3
-
None
-
None
-
Linux
Description
With the remote spi connection, it seems that the inner/outer join doesn't work with the result.getNodes() function.
My code :
Repository repository = JcrUtils.getRepository(jcrUrl);
Session session = repository.login( new SimpleCredentials("admin", "admin".toCharArray()));
String expression = ...;
QueryManager queryMgr = session.getWorkspace().getQueryManager();
Query query = queryMgr.createQuery(expression,Query.JCR_SQL2);
QueryResult result = query.execute();
Node node = result.getNodes().nextNode();
Query1 :
select node.* from [nt:unstructured] as node
Return one element.
Query2 :
select node.* from [nt:unstructured] as node
left outer join [nt:file] as file on ischildnode(file, node)
left outer join [nt:resource] as filecontent on ischildnode(filecontent, file)
Doesn't return any element :
java.util.NoSuchElementException
at org.apache.jackrabbit.jcr2spi.query.NodeIteratorImpl.nextNode(NodeIteratorImpl.java:110)
The second query should return at least one element due to left outer join.
A solution is to use ( work with both query )
Node node = result.getRows().nextRow().getNode("node");