Package javax.jcr.query

Examples of javax.jcr.query.Row


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

            // second branch
            bTime = System.currentTimeMillis();
            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


            int currentNode = 0;
            int addedNodes = 0;

            ScoreNode node = hits.nextScoreNode();
            while (node != null) {
                Row row = null;
                try {
                    row = new SelectorRow(columns, evaluator,
                            selector.getSelectorName(),
                            session.getNodeById(node.getNodeId()),
                            node.getScore());
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();
            assertTrue(nodeIt.hasNext());
View Full Code Here

     */
    protected void checkValue(RowIterator itr,
                              String propertyName,
                              String expectedValue) throws RepositoryException {
        while (itr.hasNext()) {
            Row row = itr.nextRow();
            // check fullText
            Value value = row.getValue(propertyName);
            if (value == null) {
                fail("Search Test: fails result does not contain value for selected property");
            }
            assertEquals("Value in query result row does not match expected value",
                    expectedValue, value.getString());
View Full Code Here

        }

        List resultPaths = new ArrayList();
        log.println("result:");
        for (RowIterator it = result.getRows(); it.hasNext();) {
            Row r = it.nextRow();
            StringBuffer aggregatedPaths = new StringBuffer();
            for (int i = 0; i < selectorNames.length; i++) {
                aggregatedPaths.append(getPath(r.getNode(selectorNames[i])));
                aggregatedPaths.append("|");
            }
            resultPaths.add(aggregatedPaths.toString());
            log.println(aggregatedPaths.toString());
        }
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

        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

    public NodeIterator getNodes() throws RepositoryException {
        if (selectorNames.length == 1) {
            return new NodeIteratorAdapter(getRows()) {
                @Override
                public Object next() {
                    Row row = (Row) super.next();
                    try {
                        return row.getNode();
                    } catch (RepositoryException e) {
                        throw new RuntimeException(
                                "Unable to access the node in " + row, e);
                    }
                }
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);

            // second branch
            bTime = System.currentTimeMillis();
            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

        String root = getHref("/");
        String[] selectorNames = createSelectorNames(descr);
        String[] colNames = columnNames.toArray(new String[columnNames.size()]);
        RowIterator rowIter = result.getRows();
        while (rowIter.hasNext()) {
            Row row = rowIter.nextRow();
            List<Value> values = new ArrayList<Value>();
            for (RowValue rv : descr) {
                values.add(rv.getValue(row));
            }

            // create a new ms-response for this row of the result set
            String href;
            if (join) {
                // We need a distinct href for each join result row to
                // allow the MultiStatus response to keep them separate
                href = root + "?" + n++;
            } else {
                href = getHref(row.getPath());
            }
            MultiStatusResponse resp = new MultiStatusResponse(href, null);

            // build the s-r-property
            SearchResultProperty srp = new SearchResultProperty(colNames,
View Full Code Here

TOP

Related Classes of javax.jcr.query.Row

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.