Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.Join


        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);
            assertEquals("Wrong join type", joinType, join.getJoinType());
            assertTrue("Not an EquiJoinCondition", join.getJoinCondition() instanceof EquiJoinCondition);
        }
    }
View Full Code Here


        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);
            assertEquals("Wrong join type", joinType.toString(), join.getJoinType());
            assertTrue("Not an EquiJoinCondition", join.getJoinCondition() instanceof EquiJoinCondition);
        }
    }
View Full Code Here

        // Swap the join sources to normalize all outer joins to left
        if (JCR_JOIN_TYPE_RIGHT_OUTER.equalsIgnoreCase(join.getJoinType())) {
            log.debug(
                    "{} SQL2 RIGHT OUTER JOIN transformed to LEFT OUTER JOIN.",
                    genString(printIndentation));
            Join betterJoin = qomFactory.join(join.getRight(), join.getLeft(),
                    JCR_JOIN_TYPE_LEFT_OUTER, join.getJoinCondition());
            return execute(columns, betterJoin, constraint, orderings, offset,
                    limit, printIndentation);
        }
        JoinMerger merger = JoinMerger.getJoinMerger(join,
View Full Code Here

        if (source instanceof Selector) {
            Selector selector = (Selector) source;
            return Collections.singletonMap(selector.getSelectorName(),
                    getNodeType(selector));
        } else if (source instanceof Join) {
            Join join = (Join) source;
            Map<String, NodeType> map = new LinkedHashMap<String, NodeType>();
            map.putAll(getSelectorNames(join.getLeft()));
            map.putAll(getSelectorNames(join.getRight()));
            return map;
        } else {
            throw new UnsupportedRepositoryOperationException(
                    "Unknown source type: " + source);
        }
View Full Code Here

            throws RepositoryException {
        if (source instanceof Selector) {
            Selector selector = (Selector) source;
            return Collections.singleton(selector.getSelectorName());
        } else if (source instanceof Join) {
            Join join = (Join) source;
            Set<String> set = new LinkedHashSet<String>();
            set.addAll(getSelectorNames(join.getLeft()));
            set.addAll(getSelectorNames(join.getRight()));
            return set;
        } else {
            throw new UnsupportedRepositoryOperationException(
                    "Unknown source type: " + source);
        }
View Full Code Here

        // Swap the join sources to normalize all outer joins to left
        if (JCR_JOIN_TYPE_RIGHT_OUTER.equalsIgnoreCase(join.getJoinType())) {
            log.debug(
                    "{} SQL2 RIGHT OUTER JOIN transformed to LEFT OUTER JOIN.",
                    genString(printIndentation));
            Join betterJoin = qomFactory.join(join.getRight(), join.getLeft(),
                    JCR_JOIN_TYPE_LEFT_OUTER, join.getJoinCondition());
            return execute(columns, betterJoin, constraint, orderings, offset,
                    limit, printIndentation);
        }
        JoinMerger merger = JoinMerger.getJoinMerger(join,
View Full Code Here

        if (source instanceof Selector) {
            Selector selector = (Selector) source;
            return Collections.singletonMap(selector.getSelectorName(),
                    getNodeType(selector));
        } else if (source instanceof Join) {
            Join join = (Join) source;
            Map<String, NodeType> map = new LinkedHashMap<String, NodeType>();
            map.putAll(getSelectorNames(join.getLeft()));
            map.putAll(getSelectorNames(join.getRight()));
            return map;
        } else {
            throw new UnsupportedRepositoryOperationException(
                    "Unknown source type: " + source);
        }
View Full Code Here

        if (JCR_JOIN_TYPE_RIGHT_OUTER.equalsIgnoreCase(join.getJoinType())) {
            if (log.isDebugEnabled()) {
                log.debug(genString(printIndentation)
                        + "SQL2 RIGHT OUTER JOIN transformed to LEFT OUTER JOIN.");
            }
            Join betterJoin = qomFactory.join(join.getRight(), join.getLeft(),
                    JCR_JOIN_TYPE_LEFT_OUTER, join.getJoinCondition());
            return execute(columns, betterJoin, constraint, orderings, offset,
                    limit, printIndentation);
        }
        JoinMerger merger = JoinMerger.getJoinMerger(join,
View Full Code Here

        if (source instanceof Selector) {
            Selector selector = (Selector) source;
            return Collections.singletonMap(
                    selector.getSelectorName(), getNodeType(selector));
        } else if (source instanceof Join) {
            Join join = (Join) source;
            Map<String, NodeType> map = new LinkedHashMap<String, NodeType>();
            map.putAll(getSelectorNames(join.getLeft()));
            map.putAll(getSelectorNames(join.getRight()));
            return map;
        } else {
            throw new UnsupportedRepositoryOperationException(
                    "Unknown source type: " + source);
        }
View Full Code Here

            throws RepositoryException {
        if (source instanceof Selector) {
            Selector selector = (Selector) source;
            return Collections.singleton(selector.getSelectorName());
        } else if (source instanceof Join) {
            Join join = (Join) source;
            Set<String> set = new LinkedHashSet<String>();
            set.addAll(getSelectorNames(join.getLeft()));
            set.addAll(getSelectorNames(join.getRight()));
            return set;
        } else {
            throw new UnsupportedRepositoryOperationException(
                    "Unknown source type: " + source);
        }
View Full Code Here

TOP

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

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.