Expand my Community achievements bar.

SOLVED

AEM 6.2 - Creating Query Object of type XPATH

Avatar

Level 9

 Hi All,

We are creating Query object using below code.

javax.jcr.query.Query query = queryManager.createQuery(queryString, javax.jcr.query.Query.XPATH);

As  javax.jcr.query.Query.XPATH constant has been deprecated in AEM 6.2,what will be the alternative approach to create query object of type XPATH,

I know it works even though it's deprecated but we want to change the code to comply more with the AEM 6.2

Thanks,

Kishore

1 Accepted Solution

Avatar

Correct answer by
Level 4

Do not use XPaths anymore. Use: 

Query query = builder.createQuery(PredicateGroup.create(map), session);

View solution in original post

1 Reply

Avatar

Correct answer by
Level 4

Do not use XPaths anymore. Use: 

Query query = builder.createQuery(PredicateGroup.create(map), session);