我想运行这个 JCR SQL2 查询:
SELECT * FROM [nt:base] WHERE path LIKE '/A/B/%'
但运行查询后,我得到以下异常:
javax.jcr.query.InvalidQueryException: Query:
SELECT * FROM [nt:base] WHERE jcr:(*)path LIKE '/A/B/%'; expected: (, ., =, <>, <, >, <=,
我想运行这个 JCR SQL2 查询:
SELECT * FROM [nt:base] WHERE path LIKE '/A/B/%'
但运行查询后,我得到以下异常:
javax.jcr.query.InvalidQueryException: Query:
SELECT * FROM [nt:base] WHERE jcr:(*)path LIKE '/A/B/%'; expected: (, ., =, <>, <, >, <=,
SELECT * FROM [nt:base] WHERE ISDESCENDANTNODE([/A/B/%])
在这里阅读更多
我希望这将帮助您执行查询:
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);