Question

I want to run this JCR SQL2 query:

SELECT * FROM [nt:base] WHERE path LIKE '/A/B/%'

But after running the query I am getting the following Exception:

javax.jcr.query.InvalidQueryException: Query:
SELECT * FROM [nt:base] WHERE jcr:(*)path LIKE '/A/B/%'; expected: (, ., =, <>, <, >, <=,
Was it helpful?

Solution

SELECT * FROM [nt:base] WHERE ISDESCENDANTNODE([/A/B/%])

Read more here

OTHER TIPS

I hope this will help you to execute the query:

            javax.jcr.query.QueryManager queryManager;

            queryManager = jcrsession.getWorkspace().getQueryManager();
            String expression = "select * from [nt:folder] AS s WHERE ISCHILDNODE(s,'"+name+"')and CONTAINS(s.[edms:owner],'*"+userid+"*')  ORDER BY s.["+Config.EDMS_Sorting_Parameter+"] ASC";

            javax.jcr.query.Query query = queryManager.createQuery(expression, javax.jcr.query.Query.JCR_SQL2);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top