Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.JoinCondition


        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, c);
        checkQOM(qom, new Node[][]{{n2, n1}});
    }

    public void testRightOuterJoin() throws RepositoryException {
        JoinCondition c = qf.childNodeJoinCondition(LEFT, RIGHT);
        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_RIGHT_OUTER, c);
        checkQOM(qom, new Node[][]{{n2, n1}, {null, n2}});
    }
View Full Code Here


        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_RIGHT_OUTER, c);
        checkQOM(qom, new Node[][]{{n2, n1}, {null, n2}});
    }

    public void testLeftOuterJoin() throws RepositoryException {
        JoinCondition c = qf.childNodeJoinCondition(LEFT, RIGHT);
        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_LEFT_OUTER, c);
        List result = new ArrayList();
        result.add(new Node[]{n2, n1});
        if (testRootNode.isNodeType(testNodeType)) {
            result.add(new Node[]{n1, testRootNode});
View Full Code Here

        ensureMixinType(n2, mixReferenceable);
        superuser.save();
    }

    public void testInnerJoin() throws RepositoryException {
        JoinCondition c = qf.descendantNodeJoinCondition(LEFT, RIGHT);
        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, c);
        checkQOM(qom, new Node[][]{{n2, n1}});
    }
View Full Code Here

        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, c);
        checkQOM(qom, new Node[][]{{n2, n1}});
    }

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

        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_RIGHT_OUTER, c);
        checkQOM(qom, 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);
        List result = new ArrayList();
        result.add(new Node[]{n2, n1});
        // for each ancestor-or-self of testRootNode check
        // whether it is of type testNodeType and add
View Full Code Here

     */
    public static JoinMerger getJoinMerger(
            Join join, Map<String, PropertyValue> columns,
            OperandEvaluator evaluator, QueryObjectModelFactory factory)
            throws RepositoryException {
        JoinCondition condition = join.getJoinCondition();
        if (condition instanceof EquiJoinCondition) {
            return new EquiJoinMerger(
                    join, columns, evaluator, factory,
                    (EquiJoinCondition) condition);
        } else if (condition instanceof SameNodeJoinCondition) {
View Full Code Here

     * Test case for {@link QueryObjectModelFactory#join(Source, Source, String, JoinCondition)}
     */
    public void testJoin() throws RepositoryException {
        Selector s1 = qf.selector(ntBase, SELECTOR_NAME1);
        Selector s2 = qf.selector(testNodeType, SELECTOR_NAME1);
        JoinCondition cond = qf.equiJoinCondition(ntBase, jcrPrimaryType, testNodeType, jcrPrimaryType);
        for (Iterator<String> it = JOIN_TYPES.iterator(); it.hasNext(); ) {
            String joinType = it.next();
            Join join = qf.join(s1, s2, joinType, cond);
            assertTrue("Not a selector source", join.getLeft() instanceof Selector);
            assertTrue("Not a selector source", join.getRight() instanceof Selector);
View Full Code Here

    //-----------------------------< utilities >--------------------------------

    private QueryObjectModel createQomQuery(String joinType, String relPath)
            throws RepositoryException {
        JoinCondition c;
        if (relPath != null) {
            c = qf.sameNodeJoinCondition(LEFT, RIGHT, relPath);
        } else {
            c = qf.sameNodeJoinCondition(LEFT, RIGHT, ".");
        }
View Full Code Here

        ensureMixinType(n2, mixReferenceable);
        superuser.save();
    }

    public void testInnerJoin() throws RepositoryException {
        JoinCondition c = qf.descendantNodeJoinCondition(LEFT, RIGHT);
        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, c);
        checkQOM(qom, new Node[][]{{n2, n1}});
    }
View Full Code Here

        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, c);
        checkQOM(qom, new Node[][]{{n2, n1}});
    }

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

TOP

Related Classes of javax.jcr.query.qom.JoinCondition

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.