Search code examples
javaaemjcrjackrabbit

Jcr query multiple nodes having their abs paths


I am trying to query multiple nodes having their abs paths I know I can do

session.getNode(absPath)

But I have to iterate through it, and, probably it is not the fastest solution .Is there a way to do it all together(so to say, by batch)?


Solution

  • I don't think there is a built-in method to extract many items at once given a collection of paths, however: 1. If those nodes can be found using a query (like JCR SQL), then you can use Sling's ResourceResolver.findResources or JCR's QueryManager.createQuery and execute this query. 2. If You want to map those nodes to specific Java models, then you can use Slice's ModelProvider.