Package javax.jcr.query

Examples of javax.jcr.query.QueryResult


        String sql = "SELECT * FROM nt:unstructured"
                + " WHERE \"jcr:path\" LIKE '" + testRoot + "/%"
                + "' AND CONTAINS(., '''fox juMps'' Test OR otheR')";
        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
        QueryResult result = q.execute();
        checkResult(result, 2);
    }
View Full Code Here


        String sql = "SELECT * FROM nt:base"
                + " WHERE jcr:path LIKE '" + testRoot + "/foo'"
                + " AND bla = 'bla'";
        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
        QueryResult result = q.execute();
        checkResult(result, 1);
    }
View Full Code Here

        String sql = "SELECT * FROM nt:file" +
                " WHERE jcr:path LIKE '" + testRoot + "/%'"
                + " AND bla = 'bla'";
        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
        QueryResult result = q.execute();
        checkResult(result, 0);
    }
View Full Code Here

     * @param xpath the xpath query.
     * @param nodes the expected result nodes.
     */
    protected void executeXPathQuery(Session session, String xpath, Node[] nodes)
            throws RepositoryException {
        QueryResult res = session.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH).execute();
        checkResult(res, nodes);
    }
View Full Code Here

     * @param sql the sql query.
     * @param nodes the expected result nodes.
     */
    protected void executeSqlQuery(Session session, String sql, Node[] nodes)
            throws RepositoryException {
        QueryResult res = session.getWorkspace().getQueryManager().createQuery(sql, Query.SQL).execute();
        checkResult(res, nodes);
    }
View Full Code Here

        String sql = "SELECT " + propertyName1 + " FROM " + testNodeType + " WHERE " +
                    jcrPath + " LIKE '" + testRoot + "/%' ORDER BY " + propertyName1;
        String xpath = "/" + jcrRoot + testRoot + "/*[@jcr:primaryType='" + testNodeType + "'] order by @" + propertyName1;
        Query q;
        QueryResult result;
        if (checkSQL) {
            q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
            result = q.execute();
            checkResultOrder(result, nodeNames);
        }
View Full Code Here

     * <p/>
     * For configuration description see {@link #setUpFullTextTest()}.
     */
    public void testScoreColumn() throws Exception {
        setUpFullTextTest();
        QueryResult result = execute(getFullTextStatement());
        RowIterator rows = result.getRows();
        // test mere existence
        rows.nextRow().getValue(jcrScore);
    }
View Full Code Here

     * <p/>
     * For configuration description see {@link #setUpFullTextTest()}.
     */
    public void testFullTextSearch() throws Exception {
        setUpFullTextTest();
        QueryResult result = execute(getFullTextStatement());

        // must be 1
        checkResult(result, 1);

        // evaluate result
        RowIterator itr = result.getRows();
        while (itr.hasNext()) {
            Row row = itr.nextRow();
            Value value = row.getValue(propertyName1);
            if (value != null) {
                String fullText = value.getString();
View Full Code Here

     * <p/>
     * For configuration description see {@link #setUpRangeTest()}.
     */
    public void testRange() throws Exception {
        setUpRangeTest();
        QueryResult result = execute(getRangeStatement());

        // should be 1
        checkResult(result, 1);

        // evaluate result
        checkValue(result.getRows(), propertyName1, "b");
    }
View Full Code Here

     * <p/>
     * For configuration description see {@link #setUpMultiValueTest()}.
     */
    public void testMultiValueSearch() throws Exception {
        setUpMultiValueTest();
        QueryResult result = execute(getMultiValueStatement());

        //should be 1
        checkResult(result, 1);

        //evaluate result
        checkValue(result.getRows(), propertyName1, "existence");
    }
View Full Code Here

TOP

Related Classes of javax.jcr.query.QueryResult

Copyright © 2018 www.massapicom. 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.