Package org.apache.jackrabbit.spi.commons.query.jsr283.qom

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


    /**
     * 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

        }
    }

    // Page 129
    private Source parseSource() throws RepositoryException {
        Selector selector = parseSelector();
        selectors.add(selector);
        Source source = selector;
        while (true) {
            int type;
            if (readIf("RIGHT")) {
View Full Code Here

        ArrayList columns = new ArrayList();
        for (int i = 0; i < list.size(); i++) {
            ColumnOrWildcard c = (ColumnOrWildcard) list.get(i);
            if (c.propertyName == null) {
                for (int j = 0; j < selectors.size(); j++) {
                    Selector selector = (Selector) selectors.get(j);
                    if (c.selectorName == null
                            || c.selectorName
                                    .equals(selector.getSelectorName())) {
                        Column column = factory.column(selector
                                .getSelectorName(), null, null);
                        columns.add(column);
                    }
                }
            } else {
View Full Code Here

            assertEquals("Wrong operator", operator, comp.getOperator());
        }
    }

    public void testCreateQuery() throws RepositoryException {
        Selector selector = qomFactory.selector(testNodeType);
        QueryObjectModel qom = qomFactory.createQuery(selector, null, null, null);
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
        assertNull("Constraint must be null", qom.getConstraint());
        assertEquals("Wrong size of orderings", 0, qom.getOrderings().length);
        assertEquals("Wrong size of columns", 0, qom.getColumns().length);
View Full Code Here

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

    public void testCreateQueryWithConstraint() throws RepositoryException {
        Selector selector = qomFactory.selector(testNodeType);
        PropertyExistence propExist = qomFactory.propertyExistence(propertyName1);
        QueryObjectModel qom = qomFactory.createQuery(
                selector, propExist, null, null);
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
        assertTrue("Not a property existence constraint", qom.getConstraint() instanceof PropertyExistence);
View Full Code Here

        bindVariables = new HashMap();
        read();
        read("SELECT");
        ArrayList list = parseColumns();
        read("FROM");
        Source source = parseSource();
        Column[] columnArray = resolveColumns(list);
        Constraint constraint = null;
        if (readIf("WHERE")) {
            constraint = parseConstraint();
        }
View Full Code Here

    // Page 129
    private Source parseSource() throws RepositoryException {
        Selector selector = parseSelector();
        selectors.add(selector);
        Source source = selector;
        while (true) {
            int type;
            if (readIf("RIGHT")) {
                read("OUTER");
                type = QueryObjectModelConstants.JOIN_TYPE_RIGHT_OUTER;
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.commons.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.