Package javax.jcr.query

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


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

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

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

    /**
 
View Full Code Here


        addFile(testRootNode, "file1.txt", SAMPLE_CONTENT);
        superuser.save();
        String stmt = createStatement("quick");
        RowIterator rows = GQL.execute(stmt, superuser, "jcr:content");
        assertTrue("Expected result", rows.hasNext());
        String excerpt = rows.nextRow().getValue("rep:excerpt()").getString();
        assertTrue("No excerpt returned", excerpt.startsWith("<div><span>"));
        stmt = createStatement("type:resource quick");
        rows = GQL.execute(stmt, superuser);
        assertTrue("Expected result", rows.hasNext());
        excerpt = rows.nextRow().getValue("rep:excerpt()").getString();
View Full Code Here

        String excerpt = rows.nextRow().getValue("rep:excerpt()").getString();
        assertTrue("No excerpt returned", excerpt.startsWith("<div><span>"));
        stmt = createStatement("type:resource quick");
        rows = GQL.execute(stmt, superuser);
        assertTrue("Expected result", rows.hasNext());
        excerpt = rows.nextRow().getValue("rep:excerpt()").getString();
        assertTrue("No excerpt returned", excerpt.startsWith("<div><span>"));
    }

    public void testPrefixedValue() throws RepositoryException {
        Node n1 = testRootNode.addNode("node1");
View Full Code Here

                    printIndentation + printIndentStep);
            Set<Row> allRows = new TreeSet<Row>(new RowPathComparator(
                    Arrays.asList(merger.getSelectorNames())));
            RowIterator ri1 = branch1.getRows();
            while (ri1.hasNext()) {
                Row r = ri1.nextRow();
                allRows.add(r);
            }
            log.debug("{} SQL2 JOIN executed first branch, took {} ms.",
                    genString(printIndentation), System.currentTimeMillis()
                            - bTime);
View Full Code Here

            QueryResult branch2 = execute(merger,
                    csInfo.getRightInnerConstraints(), isOuterJoin,
                    printIndentation + printIndentStep);
            RowIterator ri2 = branch2.getRows();
            while (ri2.hasNext()) {
                Row r = ri2.nextRow();
                allRows.add(r);
            }
            log.debug("{} SQL2 JOIN executed second branch, took {} ms.",
                    genString(printIndentation), System.currentTimeMillis()
                            - bTime);
View Full Code Here

                || 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

                };

                public Map<String, Object> next() {
                    Map<String, Object> row = new HashMap<String, Object>();
                    try {
                        Value[] values = rows.nextRow().getValues();
                        for (int i = 0; i < values.length; i++) {
                            Value v = values[i];
                            if (v != null) {
                                row.put(colNames[i],
                                    JcrResourceUtil.toJavaObject(values[i]));
View Full Code Here

        NodeIterator nodes = q.execute().getNodes();
        assertTrue(nodes.hasNext());
        assertTrue(nodes.nextNode() instanceof Version);
        RowIterator rows = q.execute().getRows();
        assertTrue(rows.hasNext());
        assertTrue(rows.nextRow().getNode() instanceof Version);
    }

    public void testFrozenNode() throws RepositoryException {
        Node n = testRootNode.addNode(nodeName1, testNodeType);
        n.addMixin(mixVersionable);
View Full Code Here

                    printIndentation + printIndentStep);
            Set<Row> allRows = new TreeSet<Row>(new RowPathComparator(
                    Arrays.asList(merger.getSelectorNames())));
            RowIterator ri1 = branch1.getRows();
            while (ri1.hasNext()) {
                Row r = ri1.nextRow();
                allRows.add(r);
            }
            log.debug("{} SQL2 JOIN executed first branch, took {} ms.",
                    genString(printIndentation), System.currentTimeMillis()
                            - bTime);
View Full Code Here

            QueryResult branch2 = execute(merger,
                    csInfo.getRightInnerConstraints(), isOuterJoin,
                    printIndentation + printIndentStep);
            RowIterator ri2 = branch2.getRows();
            while (ri2.hasNext()) {
                Row r = ri2.nextRow();
                allRows.add(r);
            }
            log.debug("{} SQL2 JOIN executed second branch, took {} ms.",
                    genString(printIndentation), System.currentTimeMillis()
                            - bTime);
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.