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

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


                // TODO decimal
                throw getSyntaxError("number");
            }
        }
        if (currentTokenType == VALUE) {
            Literal literal = factory.literal(currentValue);
            read();
            return literal;
        } else if (currentTokenType == PARAMETER) {
            read();
            String name = readName();
            BindVariableValue var = (BindVariableValue) bindVariables.get(name);
            if (var == null) {
                var = factory.bindVariable(name);
                bindVariables.put(name, var);
            }
            return var;
        } else if (readIf("TRUE")) {
            Literal literal = factory.literal(valueFactory.createValue(true));
            return literal;
        } else if (readIf("FALSE")) {
            Literal literal = factory.literal(valueFactory.createValue(false));
            return literal;
        } else {
            throw getSyntaxError("static operand");
        }
    }
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#nodeLocalName()}
     */
    public void testNodeLocalName() throws RepositoryException {
        NodeLocalName localName = qomFactory.nodeLocalName();
        assertNull("Selector name must be null", localName.getSelectorName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#nodeLocalName(String)}
     */
    public void testNodeLocalNameWithSelector() throws RepositoryException {
        NodeLocalName localName = qomFactory.nodeLocalName(SELECTOR_NAME1);
        assertEquals("Wrong selector name", SELECTOR_NAME1, localName.getSelectorName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#nodeName()}
     */
    public void testNodeName() throws RepositoryException {
        NodeName nodeName = qomFactory.nodeName();
        assertNull("Selector name must be null", nodeName.getSelectorName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#nodeName(String)}
     */
    public void testNodeNameWithSelector() throws RepositoryException {
        NodeName nodeName = qomFactory.nodeName(SELECTOR_NAME1);
        assertEquals("Wrong selector name", SELECTOR_NAME1, nodeName.getSelectorName());
    }
View Full Code Here

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

     * Test case for {@link QueryObjectModelFactory#or(Constraint, Constraint)}
     */
    public void testOr() throws RepositoryException {
        PropertyExistence c1 = qomFactory.propertyExistence(propertyName1);
        PropertyExistence c2 = qomFactory.propertyExistence(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

    // Page 157
    private Ordering[] parseOrder() throws RepositoryException {
        ArrayList orderList = new ArrayList();
        do {
            Ordering ordering;
            DynamicOperand op = parseDynamicOperand();
            if (readIf("DESC")) {
                ordering = factory.descending(op);
            } else {
                readIf("ASC");
View Full Code Here

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

TOP

Related Classes of org.apache.jackrabbit.spi.commons.query.jsr283.qom.EquiJoinCondition

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.