Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.QueryObjectModel.execute()


    }

    public void testRightOuterJoin() throws RepositoryException {
        JoinCondition c = qf.descendantNodeJoinCondition(LEFT, RIGHT);
        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_RIGHT_OUTER, c);
        checkResult(qom.execute(), new Node[][]{{n2, n1}, {null, n2}});
    }

    public void testLeftOuterJoin() throws RepositoryException {
        JoinCondition c = qf.descendantNodeJoinCondition(LEFT, RIGHT);
        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_LEFT_OUTER, c);
View Full Code Here


        }
        if (result.size() == 1) {
            // n1 not yet covered
            result.add(new Node[]{n1, null});
        }
        checkResult(qom.execute(), (Node[][]) result.toArray(new Node[result.size()][]));
    }
}
View Full Code Here

        QueryObjectModel qom = qf.createQuery(
                qf.selector(testNodeType, SELECTOR_1),
                null,
                null,
                new Column[]{qf.column(SELECTOR_1, null, null)});
        QueryResult result = qom.execute();
        List names = new ArrayList(Arrays.asList(result.getColumnNames()));
        NodeTypeManager ntMgr = superuser.getWorkspace().getNodeTypeManager();
        NodeType nt = ntMgr.getNodeType(testNodeType);
        PropertyDefinition[] propDefs = nt.getPropertyDefinitions();
        for (int i = 0; i < propDefs.length; i++) {
View Full Code Here

        QueryObjectModel qom = qf.createQuery(
                qf.selector(testNodeType, SELECTOR_1),
                null,
                null,
                new Column[]{qf.column(SELECTOR_1, propertyName1, propertyName1)});
        QueryResult result = qom.execute();
        List names = new ArrayList(Arrays.asList(result.getColumnNames()));
        assertTrue("Missing column: " + propertyName1, names.remove(propertyName1));
        for (Iterator it = names.iterator(); it.hasNext(); ) {
            fail(it.next() + " was not declared as a column");
        }
View Full Code Here

                new Column[]{
                        qf.column(SELECTOR_1, propertyName1, columnName1),
                        qf.column(SELECTOR_2, propertyName1, columnName2)
                }
        );
        RowIterator rows = qom.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());
    }
View Full Code Here

        testRootNode.save();
    }

    public void testInnerJoin() throws RepositoryException {
        QueryObjectModel qom = createQomQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, (String) null);
        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{n1, n1}, {n2, n2}});
    }

    public void testInnerJoinWithPath() throws RepositoryException {
        QueryObjectModel qom = createQomQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, nodeName2);
View Full Code Here

        checkResult(result, new Node[][]{{n1, n1}, {n2, n2}});
    }

    public void testInnerJoinWithPath() throws RepositoryException {
        QueryObjectModel qom = createQomQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, nodeName2);
        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{n2, n1}});
    }

    public void testLeftOuterJoin() throws RepositoryException {
       QueryObjectModel qom = qomFactory.createQuery(
View Full Code Here

                       AbstractJoinTest.JCR_JOIN_TYPE_LEFT_OUTER,
                       qomFactory.sameNodeJoinCondition(LEFT, RIGHT, ".")),
               qomFactory.descendantNode(LEFT, testRoot),
               null, null);

        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{n1, null}, {n2, n2}});
    }

    public void testLeftOuterJoinWithPath() throws RepositoryException {
        QueryObjectModel qom = createQomQuery(AbstractJoinTest.JCR_JOIN_TYPE_LEFT_OUTER, nodeName2);
View Full Code Here

        checkResult(result, new Node[][]{{n1, null}, {n2, n2}});
    }

    public void testLeftOuterJoinWithPath() throws RepositoryException {
        QueryObjectModel qom = createQomQuery(AbstractJoinTest.JCR_JOIN_TYPE_LEFT_OUTER, nodeName2);
        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{n1, null}, {n2, n1}});
    }

    public void testRightOuterJoin() throws RepositoryException {
        QueryObjectModel qom = qomFactory.createQuery(
View Full Code Here

                        AbstractJoinTest.JCR_JOIN_TYPE_RIGHT_OUTER,
                        qomFactory.sameNodeJoinCondition(LEFT, RIGHT, ".")),
                qomFactory.descendantNode(RIGHT, testRoot),
                null, null);

        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{null, n1}, {n2, n2}});
    }

    public void testRightOuterJoinWithPath() throws RepositoryException {
        QueryObjectModel qom = qomFactory.createQuery(
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.