Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.BindVariableValue


    }

    @Test
    public void createQuery() throws RepositoryException {
        Selector s = f.selector("nt:file", "x");
        BindVariableValue b = f.bindVariable("var");
        Constraint c = f.propertyExistence("x", "c");
        PropertyValue p = f.propertyValue("x", "propertyName");
        c = f.and(f.comparison(p, QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, b), c);
        Ordering o = f.ascending(p);
        Column col = f.column("x", "propertyName", "columnName");
View Full Code Here


        assertEquals(QueryObjectModelConstants.JCR_ORDER_ASCENDING, o.getOrder());
    }

    @Test
    public void bindVariable() throws RepositoryException {
        BindVariableValue b = f.bindVariable("bindVariableName");
        assertEquals("bindVariableName", b.getBindVariableName());
    }
View Full Code Here

    }

    @Test
    public void createQuery() throws RepositoryException {
        Selector s = f.selector("nodeTypeName", "x");
        BindVariableValue b = f.bindVariable("var");
        Constraint c = f.propertyExistence("x", "c");
        PropertyValue p = f.propertyValue("x", "propertyName");
        c = f.and(f.comparison(p, QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, b), c);
        Ordering o = f.ascending(p);
        Column col = f.column("selectorName", "propertyName", "columnName");
View Full Code Here

            read();
            return literal;
        } else if (currentTokenType == PARAMETER) {
            read();
            String name = readName();
            BindVariableValue var = bindVariables.get(name);
            if (var == null) {
                var = factory.bindVariable(name);
                bindVariables.put(name, var);
            }
            return var;
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#bindVariable(String)}
     */
    public void testBindVariableValue() throws RepositoryException {
        BindVariableValue bindVar = qf.bindVariable(propertyName1);
        assertEquals("Wrong variable name", propertyName1, bindVar.getBindVariableName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#comparison(DynamicOperand, String, StaticOperand)}
     */
    public void testComparison() throws RepositoryException {
        PropertyValue op1 = qf.propertyValue(SELECTOR_NAME1, propertyName1);
        BindVariableValue op2 = qf.bindVariable(VARIABLE_NAME);
        for (Iterator it = OPERATORS.iterator(); it.hasNext(); ) {
            String operator = (String) it.next();
            Comparison comp = qf.comparison(op1, operator, op2);
            assertTrue("Not a PropertyValue operand", comp.getOperand1() instanceof PropertyValue);
            assertTrue("Not a BindVariableValue operand", comp.getOperand2() instanceof BindVariableValue);
View Full Code Here

            read();
            return literal;
        } else if (currentTokenType == PARAMETER) {
            read();
            String name = readName();
            BindVariableValue var = bindVariables.get(name);
            if (var == null) {
                var = factory.bindVariable(name);
                bindVariables.put(name, var);
            }
            return var;
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#bindVariable(String)}
     */
    public void testBindVariableValue() throws RepositoryException {
        BindVariableValue bindVar = qomFactory.bindVariable(propertyName1);
        assertEquals("Wrong variable name", propertyName1, bindVar.getBindVariableName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#comparison(DynamicOperand, int, StaticOperand)}
     */
    public void testComparison() throws RepositoryException {
        PropertyValue op1 = qomFactory.propertyValue(SELECTOR_NAME1, propertyName1);
        BindVariableValue op2 = qomFactory.bindVariable(VARIABLE_NAME);
        for (Iterator it = OPERATORS.iterator(); it.hasNext(); ) {
            String operator = (String) it.next();
            Comparison comp = qomFactory.comparison(op1, operator, op2);
            assertTrue("Not a PropertyValue operand", comp.getOperand1() instanceof PropertyValue);
            assertTrue("Not a BindVariableValue operand", comp.getOperand2() instanceof BindVariableValue);
View Full Code Here

            read();
            String name = readName();
            if (readIf(":")) {
                name = name + ":" + readName();
            }
            BindVariableValue var = bindVariables.get(name);
            if (var == null) {
                var = factory.bindVariable(name);
                bindVariables.put(name, var);
            }
            return var;
View Full Code Here

TOP

Related Classes of javax.jcr.query.qom.BindVariableValue

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.