Session session = resourceResolver.adaptTo(Session.class); QueryManager queryManager = session.getWorkspace().getQueryManager(); String queryString = "SELECT child.*, page.[cq:lastReplicated] FROM [cq:PageContent] AS page " + "INNER JOIN [nt:unstructured] AS child ON ISCHILDNODE(child,page) " + "WHERE ISDESCENDANTNODE(page,'/content/geometrixx/en/') "; Query query = queryManager.createQuery(queryString, Query.JCR_SQL2); QueryResult result = query.execute(); NodeIterator nodes = result.getNodes();
javax.jcr.RepositoryException: Query contains more than one selector: [child, page] at org.apache.jackrabbit.oak.jcr.query.QueryResultImpl.getNodes(QueryResultImpl.java:161)
API Reference:
https://docs.adobe.com/content/docs/en/spec/javax.jcr/javadocs/jcr-2.0/javax/jcr/query/QueryResult.html#getNodes()
RepositoryException - if the query contains more than one selector
As the query contains more than one selector, you need to specify the selector (e.g. child or page).
Query query = queryManager.createQuery(queryString, Query.JCR_SQL2); QueryResult result = query.execute(); RowIterator rows = result.getRows(); while (rows.hasNext()) { Row row = rows.nextRow(); Node node = row.getNode("page"); }