Examples of DescendantNodeJoinCondition


Examples of javax.jcr.query.qom.DescendantNodeJoinCondition

                f.descendantNode(null, "p").toString());
    }

    @Test
    public void descendantNodeJoinCondition() throws RepositoryException {
        DescendantNodeJoinCondition d = f.descendantNodeJoinCondition("descendantSelectorName",
                "ancestorSelectorName");
        assertEquals("descendantSelectorName", d.getDescendantSelectorName());
        assertEquals("ancestorSelectorName", d.getAncestorSelectorName());
        assertEquals("ISDESCENDANTNODE([descendantSelectorName], [ancestorSelectorName])",
                d.toString());
    }
View Full Code Here

Examples of javax.jcr.query.qom.DescendantNodeJoinCondition

        assertEquals("path", d.getAncestorPath());
    }

    @Test
    public void descendantNodeJoinCondition() throws RepositoryException {
        DescendantNodeJoinCondition d = f.descendantNodeJoinCondition("descendantSelectorName",
                "ancestorSelectorName");
        assertEquals("descendantSelectorName", d.getDescendantSelectorName());
        assertEquals("ancestorSelectorName", d.getAncestorSelectorName());
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.query.jsr283.qom.DescendantNodeJoinCondition

    /**
     * Test case for {@link QueryObjectModelFactory#descendantNodeJoinCondition(String, String)}
     */
    public void testDescendantNodeJoinCondition() throws RepositoryException {
        DescendantNodeJoinCondition cond = qomFactory.descendantNodeJoinCondition(SELECTOR_NAME1, SELECTOR_NAME2);
        assertEquals("Wrong selector name", SELECTOR_NAME1, cond.getDescendantSelectorName());
        assertEquals("Wrong selector name", SELECTOR_NAME2, cond.getAncestorSelectorName());
    }
View Full Code Here

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

    /**
     * Test case for {@link QueryObjectModelFactory#descendantNodeJoinCondition(String, String)}
     */
    public void testDescendantNodeJoinCondition() throws RepositoryException {
        DescendantNodeJoinCondition cond = qomFactory.descendantNodeJoinCondition(SELECTOR_NAME1, SELECTOR_NAME2);
        assertEquals("Wrong selector name", SELECTOR_NAME1, cond.getDescendantSelectorName());
        assertEquals("Wrong selector name", SELECTOR_NAME2, cond.getAncestorSelectorName());
    }
View Full Code Here

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

    /**
     * Test case for {@link QueryObjectModelFactory#descendantNodeJoinCondition(String, String)}
     */
    public void testDescendantNodeJoinCondition() throws RepositoryException {
        DescendantNodeJoinCondition cond = qomFactory.descendantNodeJoinCondition(SELECTOR_NAME1, SELECTOR_NAME2);
        assertEquals("Wrong selector name", SELECTOR_NAME1, cond.getDescendantSelectorName());
        assertEquals("Wrong selector name", SELECTOR_NAME2, cond.getAncestorSelectorName());
    }
View Full Code Here

Examples of org.jboss.dna.graph.query.model.DescendantNodeJoinCondition

                    Path parentPath = ((Location)parentLocation).getPath();
                    return childPath.getParent().isSameAs(parentPath);
                }
            };
        } else if (condition instanceof DescendantNodeJoinCondition) {
            DescendantNodeJoinCondition joinCondition = (DescendantNodeJoinCondition)condition;
            String ancestorSelectorName = joinCondition.getAncestorSelectorName().getName();
            if (left.getColumns().hasSelector(ancestorSelectorName)) {
                // The ancestor is on the left ...
                return new Joinable() {
                    public boolean evaluate( Object ancestorLocation,
                                             Object descendantLocation ) {
View Full Code Here

Examples of org.jboss.dna.graph.query.model.DescendantNodeJoinCondition

            SelectorName parentSelector = rewrittenSelectors.get(condition.getParentSelectorName());
            if (childSelector == condition.getChildSelectorName() && parentSelector == condition.getParentSelectorName()) return condition;
            return new ChildNodeJoinCondition(parentSelector, childSelector);
        }
        if (joinCondition instanceof DescendantNodeJoinCondition) {
            DescendantNodeJoinCondition condition = (DescendantNodeJoinCondition)joinCondition;
            SelectorName ancestor = rewrittenSelectors.get(condition.getAncestorSelectorName());
            SelectorName descendant = rewrittenSelectors.get(condition.getDescendantSelectorName());
            if (ancestor == condition.getAncestorSelectorName() && descendant == condition.getDescendantSelectorName()) return condition;
            return new ChildNodeJoinCondition(ancestor, descendant);
        }
        return joinCondition;
    }
View Full Code Here

Examples of org.jboss.dna.graph.query.model.DescendantNodeJoinCondition

            if (childSelector == condition.getChildSelectorName() && parentSelector == condition.getParentSelectorName()) return condition;
            node.addSelector(childSelector, parentSelector);
            return new ChildNodeJoinCondition(parentSelector, childSelector);
        }
        if (joinCondition instanceof DescendantNodeJoinCondition) {
            DescendantNodeJoinCondition condition = (DescendantNodeJoinCondition)joinCondition;
            SelectorName ancestor = condition.getAncestorSelectorName();
            SelectorName descendant = condition.getDescendantSelectorName();
            if (ancestor.equals(viewName)) ancestor = sourceName;
            if (descendant.equals(viewName)) descendant = sourceName;
            if (ancestor == condition.getAncestorSelectorName() && descendant == condition.getDescendantSelectorName()) return condition;
            node.addSelector(ancestor, descendant);
            return new ChildNodeJoinCondition(ancestor, descendant);
        }
        return joinCondition;
    }
View Full Code Here

Examples of org.jboss.dna.graph.query.model.DescendantNodeJoinCondition

         * @param descendantTable the name or alias of the table containing the descendant node
         * @return the query builder instance, for method chaining purposes
         */
        public QueryBuilder onDescendant( String ancestorTable,
                                          String descendantTable ) {
            return createJoin(new DescendantNodeJoinCondition(nameOf(ancestorTable), nameOf(descendantTable)));
        }
View Full Code Here

Examples of org.jboss.dna.graph.query.model.DescendantNodeJoinCondition

        if (tokens.canConsume("ISDESCENDANTNODE", "(")) {
            SelectorName descendant = parseSelectorName(tokens);
            tokens.consume(',');
            SelectorName ancestor = parseSelectorName(tokens);
            tokens.consume(')');
            return new DescendantNodeJoinCondition(ancestor, descendant);
        }
        SelectorName selector1 = parseSelectorName(tokens);
        tokens.consume('.');
        String property1 = parseName(tokens, typeSystem);
        tokens.consume('=');
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.