Package org.modeshape.jcr.api.query

Examples of org.modeshape.jcr.api.query.Query.execute()


        validateQuery().rowCount(1L).useNoIndexes().validate(query, query.execute());

        // Now issue a query that will use the index.
        queryStr = "select BASE.* FROM [" + typeName + "] as BASE WHERE BASE.sysName='X'";
        query = jcrSql2Query(queryStr);
        validateQuery().rowCount(1L).useIndex("ntsome2sysname").validate(query, query.execute());

        registerValueIndex("ntusysname", "nt:unstructured", null, "*", "sysName", PropertyType.STRING);

        waitForIndexes();

View Full Code Here


        // print = true;

        queryStr = "select BASE.* FROM [nt:unstructured] as BASE WHERE BASE.sysName='X'";
        query = jcrSql2Query(queryStr);
        validateQuery().rowCount(2L).validate(query, query.execute());
    }

    @FixFor( "MODE-2313" )
    @Test
    public void shouldAllowAddingIndexWhileSessionsAreQuerying() throws Exception {
View Full Code Here

        for (int i = 0; i != 5; ++i) {
            // Compute a query plan that should use this index ...
            Query query = jcrSql2Query("SELECT * FROM [mix:title]");
            for (int j = 0; j != 5; ++j) {
                validateQuery().rowCount(2L).useIndex("titleNodes").validate(query, query.execute());
            }
        }

        final int numThreads = 10;
        final int numQueriesEachThread = 100;
View Full Code Here

                    session = repository().login();
                    Query query = jcrSql2Query(session, "SELECT * FROM [mix:title]");
                    startLatch.await();
                    for (int i = 0; i != numQueriesEachThread; ++i) {
                        // Compute a query plan that should use this index, UNLESS the index is currently undergoing rebuilding...
                        validateQuery()./*rowCount(2L).useIndex("titleNodes")*/validate(query, query.execute());
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    fail(e.getMessage());
                } finally {
View Full Code Here

        Query query = jcrSql2Query("SELECT [jcr:path] FROM [nt:unstructured] WHERE [jcr:uuid] = '" + uuid + "'");
        validateQuery()
                .rowCount(1L)
                .considerIndexes(IndexPlanners.NODE_BY_ID_INDEX_NAME, explicitNodesById)
                .useIndex(IndexPlanners.NODE_BY_ID_INDEX_NAME)
                .validate(query, query.execute());

        query = jcrSql2Query("SELECT [jcr:path] FROM [nt:unstructured] WHERE [jcr:path] = '/nodeA'");
        validateQuery()
                .rowCount(1L)
                .considerIndexes(IndexPlanners.NODE_BY_PATH_INDEX_NAME, explicitNodesByPath)
View Full Code Here

        query = jcrSql2Query("SELECT [jcr:path] FROM [nt:unstructured] WHERE [jcr:path] = '/nodeA'");
        validateQuery()
                .rowCount(1L)
                .considerIndexes(IndexPlanners.NODE_BY_PATH_INDEX_NAME, explicitNodesByPath)
                .useIndex(IndexPlanners.NODE_BY_PATH_INDEX_NAME)
                .validate(query, query.execute());

    }

    @FixFor( "MODE-2346" )
    @Test
View Full Code Here

        Query query = jcrSql2Query("SELECT [jcr:path] FROM [nt:unstructured] AS node WHERE ISDESCENDANTNODE(node, '/nodeA') AND node.[foo]='X'");
        validateQuery()
                .rowCount(1L)
                .considerIndexes(IndexPlanners.DESCENDANTS_BY_PATH_INDEX_NAME, explicitIndex)
                .useIndex(explicitIndex)
                .validate(query, query.execute());
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.