Package javax.jcr.query

Examples of javax.jcr.query.Row


     */
    public void testRow() throws Exception {
        prepareTests(Row.class);
        ignoreMethod("getValue");    // no null values for SerialValueFactory

        Row row = (Row) mock;
        RemoteRow remote = remoteFactory.getRemoteRow(row);
        Row local = localFactory.getRow(remote);

        runTests(local);
    }
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 checkResult(RowIterator result, Node[] nodes)
            throws RepositoryException {
        checkResult(new NodeIteratorAdapter(result) {
            public Object next() throws NoSuchElementException {
                Row next = (Row) super.next();
                try {
                    return superuser.getItem(next.getValue("jcr:path").getString());
                } catch (RepositoryException e) {
                    throw new NoSuchElementException();
                }
            }
        }, nodes);
View Full Code Here

        }

        Set resultPaths = new HashSet();
        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

                                              }
            }
                        if (!found) {
                            //Rows/Properties
                for (RowIterator propertiesToIndexIterator = fieldQueryResults.getRows(); propertiesToIndexIterator.hasNext(); ) {
                  Row row = propertiesToIndexIterator.nextRow();
                                //FIXME Premi�re valeur seulement ??
                                String[] columnNames = fieldQueryResults.getColumnNames();
                                for (int i = 0; i < columnNames.length; i++){

                                    if ((columnNames[i].equals("jcr:path") && columnNames.length != 2) || columnNames[i].equals("jcr:score")) {
                                        continue;
                                    }

                                    Value currentVal = row.getValue(columnNames[i]);
                                    if (currentVal != null) {
                                      lf.setValue(currentVal.getString());
                                    } else {
                                      lf.setValue("");
                                    }
View Full Code Here

            List<Row> rows = new ArrayList<Row>();
            hits = searcher.evaluate(qp.mainQuery);
            ScoreNode node = hits.nextScoreNode();
            while (node != null) {
                try {
                    Row row = new SelectorRow(
                            columns, evaluator, selector.getSelectorName(),
                            session.getNodeById(node.getNodeId()),
                            node.getScore());
                    if (filter.evaluate(row)) {
                        rows.add(row);
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

    public Node getNode() throws RepositoryException {
        throw new RepositoryException();
    }

    public Node getNode(String selectorName) throws RepositoryException {
        Row row = getRow(selectorName);
        if (row != null) {
            return row.getNode(selectorName);
        } else {
            return null;
        }
    }
View Full Code Here

    public double getScore() throws RepositoryException {
        throw new RepositoryException();
    }

    public double getScore(String selectorName) throws RepositoryException {
        Row row = getRow(selectorName);
        if (row != null) {
            return row.getScore(selectorName);
        } else {
            return 0.0;
        }
    }
View Full Code Here

     */
    protected void checkResult(RowIterator result, Node[] nodes)
            throws RepositoryException {
        checkResult(new NodeIteratorAdapter(result) {
            public Object next() throws NoSuchElementException {
                Row next = (Row) super.next();
                try {
                    return superuser.getItem(next.getValue("jcr:path").getString());
                } catch (RepositoryException e) {
                    throw new NoSuchElementException();
                }
            }
        }, nodes);
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.