javajackrabbitjcrjcr-sql2

JCR-SQL2 Query Wildcard search not working.


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: (, ., =, <>, <, >, <=,

Solution

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

    Read more here