Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
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);