Search in sources :

Example 1 with NO_MAPPINGS

use of org.apache.jackrabbit.oak.api.QueryEngine.NO_MAPPINGS in project jackrabbit-oak by apache.

the class AtomicCompositeMergeTest method queryUuid.

private static List<String> queryUuid(ContentSession session, String uuid) throws ParseException {
    Map<String, PropertyValue> bindings = Collections.singletonMap("id", PropertyValues.newString(uuid));
    Result result = session.getLatestRoot().getQueryEngine().executeQuery("SELECT * FROM [nt:base] WHERE [jcr:uuid] = $id" + QueryEngine.INTERNAL_SQL2_QUERY, Query.JCR_SQL2, bindings, NO_MAPPINGS);
    return StreamSupport.stream(result.getRows().spliterator(), false).map(r -> r.getPath()).collect(Collectors.toList());
}
Also used : CommitFailedException(org.apache.jackrabbit.oak.api.CommitFailedException) Oak(org.apache.jackrabbit.oak.Oak) QueryEngine(org.apache.jackrabbit.oak.api.QueryEngine) Mounts(org.apache.jackrabbit.oak.spi.mount.Mounts) LoggerFactory(org.slf4j.LoggerFactory) Root(org.apache.jackrabbit.oak.api.Root) Function(java.util.function.Function) Result(org.apache.jackrabbit.oak.api.Result) Closer(com.google.common.io.Closer) InitialContent(org.apache.jackrabbit.oak.InitialContent) PropertyValues(org.apache.jackrabbit.oak.plugins.memory.PropertyValues) ContentSession(org.apache.jackrabbit.oak.api.ContentSession) IOUtils(org.apache.jackrabbit.oak.commons.IOUtils) After(org.junit.After) Map(java.util.Map) UUIDUtils(org.apache.jackrabbit.oak.commons.UUIDUtils) DocumentMK(org.apache.jackrabbit.oak.plugins.document.DocumentMK) Sets.newHashSet(com.google.common.collect.Sets.newHashSet) NO_MAPPINGS(org.apache.jackrabbit.oak.api.QueryEngine.NO_MAPPINGS) StreamSupport(java.util.stream.StreamSupport) ParseException(java.text.ParseException) MemoryDocumentStore(org.apache.jackrabbit.oak.plugins.document.memory.MemoryDocumentStore) Before(org.junit.Before) JcrConstants(org.apache.jackrabbit.JcrConstants) Query(javax.jcr.query.Query) Logger(org.slf4j.Logger) PropertyValue(org.apache.jackrabbit.oak.api.PropertyValue) DocumentNodeStore(org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore) PropertyIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider) NodeStore(org.apache.jackrabbit.oak.spi.state.NodeStore) Set(java.util.Set) Test(org.junit.Test) IOException(java.io.IOException) MemoryNodeStore(org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore) Collectors(java.util.stream.Collectors) List(java.util.List) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) OpenSecurityProvider(org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) PropertyValue(org.apache.jackrabbit.oak.api.PropertyValue) Result(org.apache.jackrabbit.oak.api.Result)

Aggregations

Lists.newArrayList (com.google.common.collect.Lists.newArrayList)1 Sets.newHashSet (com.google.common.collect.Sets.newHashSet)1 Closer (com.google.common.io.Closer)1 IOException (java.io.IOException)1 ParseException (java.text.ParseException)1 Collections (java.util.Collections)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 Function (java.util.function.Function)1 Collectors (java.util.stream.Collectors)1 StreamSupport (java.util.stream.StreamSupport)1 Query (javax.jcr.query.Query)1 JcrConstants (org.apache.jackrabbit.JcrConstants)1 InitialContent (org.apache.jackrabbit.oak.InitialContent)1 Oak (org.apache.jackrabbit.oak.Oak)1 CommitFailedException (org.apache.jackrabbit.oak.api.CommitFailedException)1 ContentSession (org.apache.jackrabbit.oak.api.ContentSession)1 PropertyValue (org.apache.jackrabbit.oak.api.PropertyValue)1 QueryEngine (org.apache.jackrabbit.oak.api.QueryEngine)1