Examples of JoinCondition


Examples of javax.jcr.query.qom.JoinCondition

     * 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 it = JOIN_TYPES.iterator(); it.hasNext(); ) {
            String joinType = (String) 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

Examples of javax.jcr.query.qom.JoinCondition

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

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

Examples of javax.jcr.query.qom.JoinCondition

        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, c);
        checkResult(qom.execute(), 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);
        checkResult(qom.execute(), new Node[][]{{n2, n1}, {null, n2}});
    }
View Full Code Here

Examples of javax.jcr.query.qom.JoinCondition

        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);
        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

Examples of javax.jcr.query.qom.JoinCondition

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

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

Examples of javax.jcr.query.qom.JoinCondition

     * Test case for {@link QueryObjectModelFactory#join(Source, Source, int, JoinCondition)}
     */
    public void testJoin() throws RepositoryException {
        Selector s1 = qomFactory.selector(ntBase, SELECTOR_NAME1);
        Selector s2 = qomFactory.selector(testNodeType, SELECTOR_NAME1);
        JoinCondition cond = qomFactory.equiJoinCondition(ntBase, jcrPrimaryType, testNodeType, jcrPrimaryType);
        for (Iterator it = JOIN_TYPES.iterator(); it.hasNext(); ) {
            String joinType = (String) it.next();
            Join join = qomFactory.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

Examples of javax.jcr.query.qom.JoinCondition

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

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

Examples of javax.jcr.query.qom.JoinCondition

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

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

Examples of javax.jcr.query.qom.JoinCondition

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

    public void testLeftOuterJoin() throws RepositoryException {
        JoinCondition c = qomFactory.childNodeJoinCondition(LEFT, RIGHT);
        QueryObjectModel qom = createQuery(AbstractJoinTest.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

Examples of javax.jcr.query.qom.JoinCondition

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

    public void testInnerJoin1() throws RepositoryException {
        JoinCondition c = qomFactory.equiJoinCondition(
                LEFT, propertyName1, RIGHT, propertyName2);
        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, c);
        checkResult(qom.execute(), new Node[][]{{n1, n2}, {n2, n2}});
    }
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.