Package javax.jcr.query

Examples of javax.jcr.query.Row


         * Fetches the next {@link Row}.
         */
        private void fetchNext() {
            next = null;
            while (next == null && rows.hasNext()) {
                Row r = rows.nextRow();
                try {
                    if (filter.include(r)) {
                        next = r;
                        return;
                    }
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

            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

        QueryManager manager = session.getWorkspace().getQueryManager();
        RowIterator iterator =
            manager.createQuery(query, "JCR-SQL2").execute().getRows();
        int count = 0;
        while (iterator.hasNext()) {
            Row row = iterator.nextRow();
            long a = row.getValue("a").getLong();
            long b = row.getValue("b").getLong();
            if (a != x || a != b) {
                throw new Exception(
                        "Invalid test result: " + x + " -> " + a + ", " + b);
            }
            count++;
View Full Code Here

        QueryManager manager = session.getWorkspace().getQueryManager();
        RowIterator iterator =
            manager.createQuery(query, "JCR-SQL2").execute().getRows();
        int count = 0;
        while (iterator.hasNext()) {
            Row row = iterator.nextRow();
            long a = row.getValue("a").getLong();
            long b = row.getValue("b").getLong();
            long c = row.getValue("c").getLong();
            if (a != x || b != x || c != x) {
                throw new Exception(
                        "Invalid test result: "
                        + x + " -> " + a + ", " + b + ", " + c);
            }
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

        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

        }
        ms.setResponseDescription(responseDescription.toString());

        RowIterator rowIter = qResult.getRows();
        while (rowIter.hasNext()) {
            Row row = rowIter.nextRow();
            Value[] values = row.getValues();

            // get the jcr:path column indicating the node path and build
            // a webdav compliant resource path of it.
            String itemPath = row.getValue(JcrConstants.JCR_PATH).getString();
            // create a new ms-response for this row of the result set
            DavResourceLocator loc = locator.getFactory().createResourceLocator(locator.getPrefix(), locator.getWorkspacePath(), itemPath, false);
            String href = loc.getHref(true);
            MultiStatusResponse resp = new MultiStatusResponse(href, null);
            // build the s-r-property
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

            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

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.