Examples of propertyValue()


Examples of org.modeshape.jcr.api.query.qom.QueryObjectModelFactory.propertyValue()

        Value propertyValueObj = valueFactory.createValue(propertyValue);

        Selector selector = qomFactory.selector("notion:typed", "node");
        Constraint constraint = null;
        if (propertyName != null && operator != null) {
            PropertyValue propValue = qomFactory.propertyValue("node", propertyName);
            Literal literal = qomFactory.literal(propertyValueObj);
            constraint = qomFactory.comparison(propValue, operator, literal);
        }
        Column[] columns = new Column[2];
        columns[0] = qomFactory.column("node", "notion:booleanProperty", "notion:booleanProperty");
View Full Code Here

Examples of org.modeshape.jcr.api.query.qom.QueryObjectModelFactory.propertyValue()

        Selector car1Selector = factory.selector("car:Car", "car1");
        Selector car2Selector = factory.selector("car:Car", "car2");
        Join join = factory.join(car1Selector, car2Selector, QueryObjectModelConstants.JCR_JOIN_TYPE_INNER,
                                 factory.equiJoinCondition("car1", "car:maker", "car2", "car:maker"));
        Column[] columns = new Column[] {factory.column("car1", null, null)};
        Constraint constraint = factory.comparison(factory.propertyValue("car1", "car:maker"),
                                                   QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO,
                                                   factory.literal(session.getValueFactory().createValue("Toyota")));
        Ordering[] orderings = new Ordering[] {factory.descending(factory.propertyValue("car1", "car:year"))};
        Query query = factory.createQuery(join, constraint, orderings, columns);
        QueryResult result = query.execute();
View Full Code Here

Examples of org.modeshape.jcr.api.query.qom.QueryObjectModelFactory.propertyValue()

                                 factory.equiJoinCondition("car1", "car:maker", "car2", "car:maker"));
        Column[] columns = new Column[] {factory.column("car1", null, null)};
        Constraint constraint = factory.comparison(factory.propertyValue("car1", "car:maker"),
                                                   QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO,
                                                   factory.literal(session.getValueFactory().createValue("Toyota")));
        Ordering[] orderings = new Ordering[] {factory.descending(factory.propertyValue("car1", "car:year"))};
        Query query = factory.createQuery(join, constraint, orderings, columns);
        QueryResult result = query.execute();
        validateQuery().rowCount(9).hasColumns(carColumnNames("car1")).validate(query, result);
    }
View Full Code Here

Examples of org.modeshape.jcr.api.query.qom.QueryObjectModelFactory.propertyValue()

    @Test
    public void shouldAllowCreationAndExecutionOfQueryObjectModel() throws Exception {
        QueryManager queryManager = session.getWorkspace().getQueryManager();
        QueryObjectModelFactory qomFactory = queryManager.getQOMFactory();
        Selector selector = qomFactory.selector("car:Car", "car");
        PropertyValue propValue = qomFactory.propertyValue("car", "car:userRating");
        Literal literal = qomFactory.literal(session.getValueFactory().createValue("4")); // use a String since it's LIKE
        Constraint constraint = qomFactory.comparison(propValue, JCR_OPERATOR_LIKE, literal);
        Column[] columns = new Column[4];
        columns[0] = qomFactory.column("car", "car:maker", "maker");
        columns[1] = qomFactory.column("car", "car:model", "car:model");
View Full Code Here

Examples of org.modeshape.jcr.api.query.qom.QueryObjectModelFactory.propertyValue()

    @Test
    public void shouldAllowCreationAndExecutionOfQueryObjectModelWithLimit() throws Exception {
        QueryManager queryManager = session.getWorkspace().getQueryManager();
        QueryObjectModelFactory qomFactory = queryManager.getQOMFactory();
        Selector selector = qomFactory.selector("car:Car", "car");
        PropertyValue propValue = qomFactory.propertyValue("car", "car:userRating");
        Literal literal = qomFactory.literal(session.getValueFactory().createValue("4")); // use a String since it's LIKE
        Constraint constraint = qomFactory.comparison(propValue, JCR_OPERATOR_LIKE, literal);
        Column[] columns = new Column[4];
        columns[0] = qomFactory.column("car", "car:maker", "maker");
        columns[1] = qomFactory.column("car", "car:model", "car:model");
View Full Code Here

Examples of org.modeshape.jcr.api.query.qom.QueryObjectModelFactory.propertyValue()

        // query for a property present in a subtype which doesn't have any residuals, using a super-type selector
        String sql = "SELECT * FROM [nt:base] AS node WHERE node.fieldA = 'A_value'";
        try {
            QueryObjectModelFactory qomFactory = session.getWorkspace().getQueryManager().getQOMFactory();
            Selector selector = qomFactory.selector("nt:base", "node");
            PropertyValue propValue = qomFactory.propertyValue("node", "fieldA");
            Literal literal = qomFactory.literal(session.getValueFactory().createValue("A_value"));
            Constraint constraint = qomFactory.comparison(propValue, QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, literal);
            Query query = qomFactory.createQuery(selector, constraint, null, new Column[0]);

            assertThat(query.getStatement(), is(sql));
View Full Code Here

Examples of org.modeshape.jcr.query.QueryBuilder.OrderByOperandBuilder.propertyValue()

                    if (attribute.matches("jcr", "path")) {
                        String pathOf = tableName;
                        if (pathOf == null) pathOf = aliases.iterator().next();
                        operandBuilder.path(pathOf);
                    } else {
                        operandBuilder.propertyValue(tableName, attribute.toString());
                        builder.select(tableName + "." + attribute.toString());
                    }
                } else if (spec.getScoreFunction() != null) {
                    // This order-by is defined by a "jcr:score" function ...
                    FunctionCall scoreFunction = spec.getScoreFunction();
View Full Code Here

Examples of org.modeshape.jcr.query.QueryBuilder.OrderByOperandBuilder.propertyValue()

                    NameTest attribute = ((AttributeNameTest) ((AxisStep)axesSteps.get(1)).getNodeTest()).getNameTest();

                    builder.select(tableName + "." + attribute.toString());
                    builder.join("nt:base as " + alias).onChildNode(tableName, alias);
                    operandBuilder.propertyValue(alias, attribute.toString());
                }
            }
            orderByBuilder.end();
        }
        // Try building this query, because we need to check the # of columns selected and the # of sources ...
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.