Package org.apache.jackrabbit.spi.commons.query.jsr283.qom

Examples of org.apache.jackrabbit.spi.commons.query.jsr283.qom.QueryObjectModel


        n2.addMixin(mixReferenceable);
        testRootNode.save();
    }

    public void testInnerJoin() throws RepositoryException {
        QueryObjectModel qom = createQuery(JOIN_TYPE_INNER, (String) null);
        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{n1, n1}, {n2, n2}});
    }
View Full Code Here


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

    public void testInnerJoinWithPath() throws RepositoryException {
        QueryObjectModel qom = createQuery(JOIN_TYPE_INNER, nodeName2);
        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{n2, n1}});
    }
View Full Code Here

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

    public void testLeftOuterJoin() throws RepositoryException {
       QueryObjectModel qom = qomFactory.createQuery(
               qomFactory.join(
                        qomFactory.selector(testNodeType, LEFT),
                        qomFactory.selector(mixReferenceable, RIGHT),
                        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}});
    }
View Full Code Here

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

    public void testLeftOuterJoinWithPath() throws RepositoryException {
        QueryObjectModel qom = createQuery(JOIN_TYPE_LEFT_OUTER, nodeName2);
        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{n1, null}, {n2, n1}});
    }
View Full Code Here

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

    public void testRightOuterJoin() throws RepositoryException {
        QueryObjectModel qom = qomFactory.createQuery(
                qomFactory.join(
                         qomFactory.selector(mixReferenceable, LEFT),
                         qomFactory.selector(testNodeType, RIGHT),
                         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}});
    }
View Full Code Here

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

    public void testRightOuterJoinWithPath() throws RepositoryException {
        QueryObjectModel qom = qomFactory.createQuery(
                qomFactory.join(
                         qomFactory.selector(mixReferenceable, LEFT),
                         qomFactory.selector(testNodeType, RIGHT),
                         JOIN_TYPE_RIGHT_OUTER,
                         qomFactory.sameNodeJoinCondition(LEFT, RIGHT, nodeName2)
                 ),
                qomFactory.descendantNode(RIGHT, testRoot),
                null, null);

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

        }
    }

    // Page 129
    private Source parseSource() throws RepositoryException {
        Selector selector = parseSelector();
        selectors.add(selector);
        Source source = selector;
        while (true) {
            int type;
            if (readIf("RIGHT")) {
View Full Code Here

        ArrayList columns = new ArrayList();
        for (int i = 0; i < list.size(); i++) {
            ColumnOrWildcard c = (ColumnOrWildcard) list.get(i);
            if (c.propertyName == null) {
                for (int j = 0; j < selectors.size(); j++) {
                    Selector selector = (Selector) selectors.get(j);
                    if (c.selectorName == null
                            || c.selectorName
                                    .equals(selector.getSelectorName())) {
                        Column column = factory.column(selector
                                .getSelectorName(), null, null);
                        columns.add(column);
                    }
                }
            } else {
View Full Code Here

        bindVariables = new HashMap();
        read();
        read("SELECT");
        ArrayList list = parseColumns();
        read("FROM");
        Source source = parseSource();
        Column[] columnArray = resolveColumns(list);
        Constraint constraint = null;
        if (readIf("WHERE")) {
            constraint = parseConstraint();
        }
View Full Code Here

    // Page 129
    private Source parseSource() throws RepositoryException {
        Selector selector = parseSelector();
        selectors.add(selector);
        Source source = selector;
        while (true) {
            int type;
            if (readIf("RIGHT")) {
                read("OUTER");
                type = QueryObjectModelConstants.JOIN_TYPE_RIGHT_OUTER;
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.commons.query.jsr283.qom.QueryObjectModel

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.