Package javax.jcr.query

Examples of javax.jcr.query.RowIterator.nextRow()


                || limit >= 0) {
            List<Row> rows = new ArrayList<Row>();

            RowIterator iterator = result.getRows();
            while (iterator.hasNext()) {
                rows.add(iterator.nextRow());
            }

            if (orderings != null && orderings.length > 0) {
                Collections.sort(rows, new RowComparator(orderings, evaluator));
            }
View Full Code Here


                || offset != 0 || limit >= 0) {
            List<Row> rows = new ArrayList<Row>();

            RowIterator iterator = result.getRows();
            while (iterator.hasNext()) {
                rows.add(iterator.nextRow());
            }

            if (orderings != null && orderings.length > 0) {
                Collections.sort(rows, new RowComparator(orderings, evaluator));
            }
View Full Code Here

            Query q = qm.createQuery("select text from [nt:base] where id = $id", Query.JCR_SQL2);
            q.bindValue("id", vf.createValue("1"));
            QueryResult r = q.execute();
            RowIterator it = r.getRows();
            assertTrue(it.hasNext());
            Row row = it.nextRow();
            assertEquals("hello world", row.getValue("text").getString());
            assertFalse(it.hasNext());

            r = q.execute();
            NodeIterator nodeIt = r.getNodes();
View Full Code Here

            log.println(" NONE");
        } else if (count == -1) {
            // have to count in a loop
            count = 0;
            while (itr.hasNext()) {
                itr.nextRow();
                count++;
            }
        }
        assertEquals("Wrong hit count.", hits, count);
    }
View Full Code Here

        );
        forQOMandSQL2(qom, new Callable() {
            public Object call(Query query) throws RepositoryException {
                RowIterator rows = query.execute().getRows();
                assertTrue("empty result", rows.hasNext());
                Row r = rows.nextRow();
                assertEquals("unexpected value", TEST_VALUE, r.getValue(columnName1).getString());
                assertEquals("unexpected value", TEST_VALUE, r.getValue(columnName2).getString());
                return null;
            }
        });
View Full Code Here

    public void testScoreColumn() throws Exception {
        setUpFullTextTest();
        QueryResult result = execute(getFullTextStatement());
        RowIterator rows = result.getRows();
        // test mere existence
        rows.nextRow().getValue(jcrScore);
    }

    /**
     * Test full-text search of the repository.
     * <p>
 
View Full Code Here

        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();
                if (fullText.indexOf("cat") > 0) {
                    fail("Search Text: full text search not correct, returned prohibited text");
View Full Code Here

        }
        // re-aquire rows
        rows = result.getRows();

        // test mere existence
        rows.nextRow().getValue(jcrPath);
    }

    //------------------------< internal >--------------------------------------

    /**
 
View Full Code Here

    public void testScoreColumn() throws Exception {
        setUpFullTextTest();
        QueryResult result = execute(getFullTextStatement());
        RowIterator rows = result.getRows();
        // test mere existence
        rows.nextRow().getValue(jcrScore);
    }

    /**
     * Test full-text search of the repository.<br>
     * <p>
 
View Full Code Here

        }
        // re-aquire rows
        rows = result.getRows();

        // test mere existence
        rows.nextRow().getValue(jcrPath);
    }

    //---------------------------< internal >-----------------------------------

    /**
 
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.