Examples of SameNode


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

    /**
     * Test case for {@link QueryObjectModelFactory#sameNode(String, String)}
     */
    public void testSameNodeWithSelector() throws RepositoryException {
        SameNode sameNode = qomFactory.sameNode(SELECTOR_NAME1, testRootNode.getPath());
        assertEquals("Wrong selector name", SELECTOR_NAME1, sameNode.getSelectorName());
        assertEquals("Wrong path", testRootNode.getPath(), sameNode.getPath());
    }
View Full Code Here

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

    /**
     * Test case for {@link QueryObjectModelFactory#sameNode(String)}
     */
    public void testSameNode() throws RepositoryException {
        SameNode sameNode = qomFactory.sameNode(testRootNode.getPath());
        assertNull("Selector name must be null", sameNode.getSelectorName());
        assertEquals("Wrong path", testRootNode.getPath(), sameNode.getPath());
    }
View Full Code Here

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

    /**
     * Test case for {@link QueryObjectModelFactory#sameNode(String, String)}
     */
    public void testSameNodeWithSelector() throws RepositoryException {
        SameNode sameNode = qomFactory.sameNode(SELECTOR_NAME1, testRootNode.getPath());
        assertEquals("Wrong selector name", SELECTOR_NAME1, sameNode.getSelectorName());
        assertEquals("Wrong path", testRootNode.getPath(), sameNode.getPath());
    }
View Full Code Here

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

                    return analyzer.isDescendantOf(location, ancestorPath);
                }
            };
        }
        if (constraint instanceof SameNode) {
            SameNode sameNode = (SameNode)constraint;
            final int locationIndex = columns.getLocationIndex(sameNode.getSelectorName().getName());
            final String path = sameNode.getPath();
            if (analyzer != null) {
                return new ConstraintChecker() {
                    public boolean satisfiesConstraints( Object[] tuple ) {
                        Location location = (Location)tuple[locationIndex];
                        return analyzer.isSameNode(location, path);
View Full Code Here

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

            Constraint wrapped = replaceReferencesToRemovedSource(context, not.getConstraint(), rewrittenSelectors);
            if (wrapped == not.getConstraint()) return not;
            return new Not(wrapped);
        }
        if (constraint instanceof SameNode) {
            SameNode sameNode = (SameNode)constraint;
            SelectorName replacement = rewrittenSelectors.get(sameNode.getSelectorName());
            if (replacement == null) return sameNode;
            return new SameNode(replacement, sameNode.getPath());
        }
        if (constraint instanceof ChildNode) {
            ChildNode childNode = (ChildNode)constraint;
            SelectorName replacement = rewrittenSelectors.get(childNode.getSelectorName());
            if (replacement == null) return childNode;
View Full Code Here

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

            Not not = (Not)constraint;
            Constraint wrapped = replaceReferences(context, not.getConstraint(), mapping, node);
            return wrapped == not.getConstraint() ? not : new Not(wrapped);
        }
        if (constraint instanceof SameNode) {
            SameNode sameNode = (SameNode)constraint;
            if (!mapping.getOriginalName().equals(sameNode.getSelectorName())) return sameNode;
            if (!mapping.isMappedToSingleSelector()) return sameNode;
            SelectorName selector = mapping.getSingleMappedSelectorName();
            node.addSelector(selector);
            return new SameNode(selector, sameNode.getPath());
        }
        if (constraint instanceof ChildNode) {
            ChildNode childNode = (ChildNode)constraint;
            if (!mapping.getOriginalName().equals(childNode.getSelectorName())) return childNode;
            if (!mapping.isMappedToSingleSelector()) return childNode;
View Full Code Here

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

         * @param asNodeAtPath the path to the node
         * @return the constraint builder that was used to create this clause; never null
         */
        public ConstraintBuilder isSameNode( String table,
                                             String asNodeAtPath ) {
            return setConstraint(new SameNode(selector(table), asNodeAtPath));
        }
View Full Code Here

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

                selectorName = parseSelectorName(tokens);
                tokens.consume(',');
            }
            String path = parsePath(tokens, typeSystem);
            tokens.consume(')');
            constraint = new SameNode(selectorName, path);
        } else if (tokens.canConsume("ISCHILDNODE", "(")) {
            SelectorName selectorName = null;
            if (tokens.matches(ANY_VALUE, ")")) {
                if (!(source instanceof Selector)) {
                    String msg = GraphI18n.functionIsAmbiguous.text("ISCHILDNODE()", pos.getLine(), pos.getColumn());
View Full Code Here

Examples of org.modeshape.jcr.query.model.SameNode

    @Test
    public void shouldParseConstraintFromStringWithOuterParentheses() {
        NamedSelector selector = new NamedSelector(selectorName("tableA"));
        Constraint constraint = parser.parseConstraint(tokens("( ISSAMENODE('/a/b') )"), typeSystem, selector);
        assertThat(constraint, is(instanceOf(SameNode.class)));
        SameNode same = (SameNode)constraint;
        assertThat(same.selectorName(), is(selectorName("tableA")));
        assertThat(same.getPath(), is("/a/b"));
    }
View Full Code Here

Examples of org.modeshape.jcr.query.model.SameNode

    @Test
    public void shouldParseConstraintFromStringWithMultipleOuterParentheses() {
        NamedSelector selector = new NamedSelector(selectorName("tableA"));
        Constraint constraint = parser.parseConstraint(tokens("((( ISSAMENODE('/a/b') )))"), typeSystem, selector);
        assertThat(constraint, is(instanceOf(SameNode.class)));
        SameNode same = (SameNode)constraint;
        assertThat(same.selectorName(), is(selectorName("tableA")));
        assertThat(same.getPath(), is("/a/b"));
    }
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.