Package org.apache.jackrabbit.core.query.jsr283.qom

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


    }

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


    }

    public void testCreateQueryFromSourceWithConstraintAndOrdering() throws RepositoryException {
        Source selector = qomFactory.selector(testNodeType);
        PropertyExistence propExist = qomFactory.propertyExistence(propertyName1);
        PropertyValue propValue = qomFactory.propertyValue(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);
        assertTrue("Not a property existence constraint", qom.getConstraint() instanceof PropertyExistence);
View Full Code Here

    }

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

    /**
     * Test case for {@link QueryObjectModelFactory#descending(DynamicOperand)}
     */
    public void testOrderingDescending() throws RepositoryException {
        PropertyValue op = qomFactory.propertyValue(propertyName1);
        Ordering desc = qomFactory.descending(op);
        assertEquals("Ordering.getOrder() must return QueryObjectModelConstants.ORDER_DESCENDING",
                QueryObjectModelConstants.ORDER_DESCENDING, desc.getOrder());
        assertTrue("Not a PropertyValue operand", desc.getOperand() instanceof PropertyValue);
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#length(PropertyValue)}
     */
    public void testLength() throws RepositoryException {
        PropertyValue propValue = qomFactory.propertyValue(propertyName1);
        Length len = qomFactory.length(propValue);
        assertNotNull("Property value must not be null", len.getPropertyValue());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#lowerCase(DynamicOperand)}
     */
    public void testLowerCase() throws RepositoryException {
        PropertyValue propValue = qomFactory.propertyValue(propertyName1);
        LowerCase lower = qomFactory.lowerCase(propValue);
        assertTrue("Not a property value operand", lower.getOperand() instanceof PropertyValue);
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#propertyValue(String)}
     */
    public void testPropertyValue() throws RepositoryException {
        PropertyValue propVal = qomFactory.propertyValue(propertyName1);
        assertNull("Selector name must be null", propVal.getSelectorName());
        assertEquals("Wrong property name", propertyName1, propVal.getPropertyName());
    }
View Full Code Here

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

    /**
     * Test case for {@link QueryObjectModelFactory#upperCase(DynamicOperand)}
     */
    public void testUpperCase() throws RepositoryException {
        PropertyValue propValue = qomFactory.propertyValue(propertyName1);
        UpperCase upper = qomFactory.upperCase(propValue);
        assertTrue("Not a property value operand", upper.getOperand() instanceof PropertyValue);
    }
View Full Code Here

        Path[] orderProps = new Path[orderings.length];
        boolean[] orderSpecs = new boolean[orderings.length];
        for (int i = 0; i < orderings.length; i++) {
            orderSpecs[i] = orderings[i].getOrder() == QueryObjectModelConstants.ORDER_ASCENDING;
            if (orderings[i].getOperand() instanceof PropertyValue) {
                PropertyValue pv = (PropertyValue) orderings[i].getOperand();
                orderProps[i] = PathFactoryImpl.getInstance().create(pv.getPropertyName());
            } else {
                throw new UnsupportedRepositoryOperationException("order by with" +
                        orderings[i].getOperand() + " not yet implemented");
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.query.jsr283.qom.PropertyValue

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.