jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grégory OLIVER (JIRA) <j...@apache.org>
Subject [jira] [Created] (JCR-3458) Remote SPI connection getNodes() throw NoSuchElementException
Date Thu, 15 Nov 2012 21:41:13 GMT
Grégory OLIVER created JCR-3458:

             Summary: Remote SPI connection getNodes() throw NoSuchElementException
                 Key: JCR-3458
                 URL: https://issues.apache.org/jira/browse/JCR-3458
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-jcr2spi
    Affects Versions: 2.4.3
         Environment: Linux
            Reporter: Grégory OLIVER

With the remote spi connection, it seems that the inner/outer join doesn't work with the result.getNodes()

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 :
    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");

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message