この会話は、活動がないためロックされています。新しい投稿を作成してください。
この会話は、活動がないためロックされています。新しい投稿を作成してください。
Hi,
I am running an INNER JOIN query(javax.jcr.query.Query). I am getting an exception:
javax.jcr.RepositoryException: This query result contains more than one selector .
However when I am running this query directly in CRXDE it runs fine. Any idea.
Sample query:
SELECT parent.* FROM [cq:Page] AS parent INNER JOIN [nt:base] AS child ON ISCHILDNODE(child,parent) WHERE ISDESCENDANTNODE(parent, '/content')
and NAME(child) = 'status'AND child.[cq:template] = '/libs/cq/personalization/templates/campaign'
Regards,
Shallu Rohilla
解決済! 解決策の投稿を見る。
表示
返信
いいね!の合計
Instead of using query.execute().getNodes() method use the following snippet to get the iterator-
final QueryResult result = query.execute();final RowIterator iterator = result.getRows(); while (iterator.hasNext()) { final Row row = iterator.nextRow(); Node node = session.getNode(row.getPath("parent")); }
表示
返信
いいね!の合計
If you are using JCR API to execute this SQL2 query then you will have to use a different method to get the node returned by the query.
//Normal SQL2 query execution final RowIterator iterator = result.getRows(); while (iterator.hasNext()) { final Row row = iterator.nextRow(); Node node = row.getNode(); } //for multiple selectors you need to use the following method final RowIterator iterator = result.getRows(); while (iterator.hasNext()) { final Row row = iterator.nextRow(); Node node = session.getNode(row.getPath(“parent”)); }
Reference - https://issues.apache.org/jira/browse/JCR-3089
表示
返信
いいね!の合計
Actually I am getting error on calling query.execute method itself(see the underlined code).
QueryManager queryManager = session.getWorkspace().getQueryManager();
Query query = queryManager.createQuery(statement, Query.JCR_SQL2);
query.setLimit(nodeSearchCriteria.getLimit());
query.setOffset(nodeSearchCriteria.getStart());
final NodeIterator iterator = query.execute().getNodes();
Regards,
Shallu Rohilla
表示
返信
いいね!の合計
Instead of using query.execute().getNodes() method use the following snippet to get the iterator-
final QueryResult result = query.execute();final RowIterator iterator = result.getRows(); while (iterator.hasNext()) { final Row row = iterator.nextRow(); Node node = session.getNode(row.getPath("parent")); }
表示
返信
いいね!の合計
Thanks Kunal.That helps!!
表示
返信
いいね!の合計
Hi Shallu,
Are you executing this query via OSGI service? If yes, Can you please share the code snippet.
Meanwhile please take a look at Community article on it @ https://helpx.adobe.com/experience-manager/using/querying-experience-manager-data-using1.html
表示
返信
いいね!の合計