Examples of PropertyExistence


Examples of javax.jcr.query.qom.PropertyExistence

        assertEquals("Wrong size of columns", 0, qom.getColumns().length);
    }

    public void testCreateQueryFromSourceWithConstraintAndOrdering() throws RepositoryException {
        Source selector = qomFactory.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qomFactory.propertyExistence(SELECTOR_NAME1, propertyName1);
        PropertyValue propValue = qomFactory.propertyValue(SELECTOR_NAME1, propertyName1);
        Ordering ordering = qomFactory.ascending(propValue);
        QueryObjectModel qom = qomFactory.createQuery(selector, propExist,
                new Ordering[]{ordering}, null);
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
View Full Code Here

Examples of javax.jcr.query.qom.PropertyExistence

        assertEquals("Wrong size of columns", 0, qom.getColumns().length);
    }

    public void testCreateQueryFromSourceWithConstraintOrderingAndColumn() throws RepositoryException {
        Source selector = qomFactory.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qomFactory.propertyExistence(SELECTOR_NAME1, propertyName1);
        PropertyValue propValue = qomFactory.propertyValue(SELECTOR_NAME1, propertyName1);
        Ordering ordering = qomFactory.ascending(propValue);
        Column column = qomFactory.column(SELECTOR_NAME1, propertyName1, null);
        QueryObjectModel qom = qomFactory.createQuery(selector, propExist,
                new Ordering[]{ordering}, new Column[]{column});
View Full Code Here

Examples of javax.jcr.query.qom.PropertyExistence

    /**
     * Test case for {@link QueryObjectModelFactory#not(Constraint)}
     */
    public void testNot() throws RepositoryException {
        PropertyExistence propExist = qomFactory.propertyExistence(SELECTOR_NAME1, propertyName1);
        Not not = qomFactory.not(propExist);
        assertTrue("Not a property existence constraint", not.getConstraint() instanceof PropertyExistence);
    }
View Full Code Here

Examples of javax.jcr.query.qom.PropertyExistence

    /**
     * Test case for {@link QueryObjectModelFactory#or(Constraint, Constraint)}
     */
    public void testOr() throws RepositoryException {
        PropertyExistence c1 = qomFactory.propertyExistence(SELECTOR_NAME1, propertyName1);
        PropertyExistence c2 = qomFactory.propertyExistence(SELECTOR_NAME1, propertyName2);
        Or or = qomFactory.or(c1, c2);
        assertTrue("Not a PropertyExistence constraint",
                or.getConstraint1() instanceof PropertyExistence);
        assertTrue("Not a PropertyExistence constraint",
                or.getConstraint2() instanceof PropertyExistence);
View Full Code Here

Examples of javax.jcr.query.qom.PropertyExistence

    /**
     * Test case for {@link QueryObjectModelFactory#propertyExistence(String)}
     */
    public void testPropertyExistence() throws RepositoryException {
        PropertyExistence propExist = qomFactory.propertyExistence(SELECTOR_NAME1, propertyName1);
        assertEquals("Wrong selector", SELECTOR_NAME1, propExist.getSelectorName());
        assertEquals("Wrong property name", propertyName1, propExist.getPropertyName());
    }
View Full Code Here

Examples of javax.jcr.query.qom.PropertyExistence

    /**
     * Test case for {@link QueryObjectModelFactory#propertyExistence(String, String)}
     */
    public void testPropertyExistenceWithSelector() throws RepositoryException {
        PropertyExistence propExist = qomFactory.propertyExistence(SELECTOR_NAME1, propertyName1);
        assertEquals("Wrong selector name", SELECTOR_NAME1, propExist.getSelectorName());
        assertEquals("Wrong property name", propertyName1, propExist.getPropertyName());
    }
View Full Code Here

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

    /**
     * Test case for {@link QueryObjectModelFactory#and(Constraint, Constraint)}
     */
    public void testAnd() throws RepositoryException {
        PropertyExistence c1 = qomFactory.propertyExistence(propertyName1);
        PropertyExistence c2 = qomFactory.propertyExistence(propertyName2);
        And and = qomFactory.and(c1, c2);
        assertTrue("Not a PropertyExistence constraint",
                and.getConstraint1() instanceof PropertyExistence);
        assertTrue("Not a PropertyExistence constraint",
                and.getConstraint2() instanceof PropertyExistence);
View Full Code Here

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

    /**
     * Test case for {@link QueryObjectModelFactory#and(Constraint, Constraint)}
     */
    public void testAnd() throws RepositoryException {
        PropertyExistence c1 = qomFactory.propertyExistence(propertyName1);
        PropertyExistence c2 = qomFactory.propertyExistence(propertyName2);
        And and = qomFactory.and(c1, c2);
        assertTrue("Not a PropertyExistence constraint",
                and.getConstraint1() instanceof PropertyExistence);
        assertTrue("Not a PropertyExistence constraint",
                and.getConstraint2() instanceof PropertyExistence);
View Full Code Here

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

                    return location.toString().equals(path);
                }
            };
        }
        if (constraint instanceof PropertyExistence) {
            PropertyExistence propertyExistance = (PropertyExistence)constraint;
            String selectorName = propertyExistance.getSelectorName().getName();
            final String propertyName = propertyExistance.getPropertyName();
            if (analyzer != null) {
                final int locationIndex = columns.getLocationIndex(selectorName);
                return new ConstraintChecker() {
                    public boolean satisfiesConstraints( Object[] tuple ) {
                        Location location = (Location)tuple[locationIndex];
View Full Code Here

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

            SelectorName replacement = rewrittenSelectors.get(descendantNode.getSelectorName());
            if (replacement == null) return descendantNode;
            return new DescendantNode(replacement, descendantNode.getAncestorPath());
        }
        if (constraint instanceof PropertyExistence) {
            PropertyExistence existence = (PropertyExistence)constraint;
            SelectorName replacement = rewrittenSelectors.get(existence.getSelectorName());
            if (replacement == null) return existence;
            return new PropertyExistence(replacement, existence.getPropertyName());
        }
        if (constraint instanceof FullTextSearch) {
            FullTextSearch search = (FullTextSearch)constraint;
            SelectorName replacement = rewrittenSelectors.get(search.getSelectorName());
            if (replacement == null) return search;
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.