Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.BindVariableValue


            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


    public Value getValue(StaticOperand operand) throws RepositoryException {
        if (operand instanceof Literal) {
            Literal literal = (Literal) operand;
            return literal.getLiteralValue();
        } else if (operand instanceof BindVariableValue) {
            BindVariableValue bvv = (BindVariableValue) operand;
            Value value = variables.get(bvv.getBindVariableName());
            if (value != null) {
                return value;
            } else {
                throw new RepositoryException(
                        "Unknown bind variable: " + bvv.getBindVariableName());
            }
        } else {
            throw new UnsupportedRepositoryOperationException(
                    "Unknown static operand type: " + operand);
        }
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

        assertEquals("[selectorName].[propertyName]", p.toString());
    }

    @Test
    public void bindVariable() throws RepositoryException {
        BindVariableValue b = f.bindVariable("bindVariableName");
        assertEquals("bindVariableName", b.getBindVariableName());
        assertEquals("$bindVariableName", b.toString());
    }
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("x", "propertyName", "columnName");
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

            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

            if (operand instanceof Literal) {
                Literal literal = (Literal)operand;
                return factory.create(literal.value());
            }
            if (operand instanceof BindVariableValue) {
                BindVariableValue bind = (BindVariableValue)operand;
                return factory.create(variables.get(bind.getBindVariableName()));
            }
            throw new LocalIndexException("Unexpected static operand: " + operand);
        }
View Full Code Here

            if (operand instanceof Literal) {
                Literal literal = (Literal)operand;
                return factory.create(literal.value());
            }
            if (operand instanceof BindVariableValue) {
                BindVariableValue bind = (BindVariableValue)operand;
                return factory.create(variables.get(bind.getBindVariableName()));
            }
            throw new LocalIndexException("Unexpected static operand: " + operand);
        }
View Full Code Here

        assertEquals("[selectorName].[propertyName]", p.toString());
    }

    @Test
    public void bindVariable() throws RepositoryException {
        BindVariableValue b = f.bindVariable("bindVariableName");
        assertEquals("bindVariableName", b.getBindVariableName());
        assertEquals("$bindVariableName", b.toString());
    }
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.