Examples of comparison()


Examples of de.danielbechler.diff.ObjectDifferBuilder.comparison()

    final EncompassingClass working = new EncompassingClass(prop2);

    final ObjectDifferBuilder builder = ObjectDifferBuilder.startBuilding();

    // (Option 1) Causes the ObjectDiffer to compare using the method "getProp1" on the 'prop' property of the root object
    builder.comparison()
        .ofNode(NodePath.with("prop"))
        .toUseEqualsMethodOfValueProvidedByMethod("getProp1");

    final DiffNode node = builder.build().compare(working, base);
View Full Code Here

Examples of de.danielbechler.diff.ObjectDifferBuilder.comparison()

    final List<String> propertyNames = asList("things", "include");
    ObjectDifferBuilder builder = ObjectDifferBuilder.startBuilding();
    for (final String name : propertyNames)
    {
      final NodePath nodePath = NodePath.with(name);
      builder.comparison().ofNode(nodePath).toUseEqualsMethod();
      builder.inclusion().include().node(nodePath);
    }

    final Thing thingOne = new Thing("a", "b");
    final Thing thingTwo = new Thing("aa", "bb");
View Full Code Here

Examples of javax.jcr.query.qom.QueryObjectModelFactory.comparison()

                                for (String newLanguageCode : newLanguageCodes) {
                                    Constraint currentConstraint = NO_LOCALE
                                            .equals(newLanguageCode) ? qomFactory.not(qomFactory
                                            .propertyExistence(selector.getSelectorName(),
                                                    Constants.JCR_LANGUAGE))
                                            : qomFactory
                                                    .comparison(
                                                            qomFactory.propertyValue(
                                                                    selector.getSelectorName(),
                                                                    Constants.JCR_LANGUAGE),
                                                            QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO,
View Full Code Here

Examples of javax.jcr.query.qom.QueryObjectModelFactory.comparison()

        for (int j = 0; j < constraints.length; j++) {
            String prop = constraints[j++];
            String val = constraints[j];

            qomBuilder.andConstraint(factory.comparison(factory.propertyValue("event", prop),
                    QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO,
                    factory.literal(session.getValueFactory().createValue(val))));
        }

View Full Code Here

Examples of javax.jcr.query.qom.QueryObjectModelFactory.comparison()

    // selector
    final Selector selector = fac.selector( "nt:base", selectorName ); //$NON-NLS-1$
    // constraint1
    Constraint origParentFolderPathConstraint =
        fac.comparison( fac.propertyValue( selectorName, pentahoJcrConstants.getPHO_ORIGPARENTFOLDERPATH() ),
            QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, fac.literal( session.getValueFactory().createValue(
                origParentFolderPath ) ) );
    // constraint2
    Constraint origNameConstraint = null;
    if ( StringUtils.hasLength( filter ) ) {
View Full Code Here

Examples of javax.jcr.query.qom.QueryObjectModelFactory.comparison()

    // constraint2
    Constraint origNameConstraint = null;
    if ( StringUtils.hasLength( filter ) ) {
      String convertedFilter = filter.replace( '*', '%' );
      origNameConstraint =
          fac.comparison( fac.propertyValue( selectorName, pentahoJcrConstants.getPHO_ORIGNAME() ),
              QueryObjectModelConstants.JCR_OPERATOR_LIKE, fac.literal( session.getValueFactory().createValue(
                  convertedFilter ) ) );
    }
    // constraint3
    Constraint descendantNodeConstraint = fac.descendantNode( selectorName, trashNode.getPath() );
View Full Code Here

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

        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");
        columns[1] = qomFactory.column("node", "notion:booleanProperty2", "notion:booleanProperty2");
        Ordering[] orderings = null;
View Full Code Here

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

        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.comparison()

        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");
        columns[2] = qomFactory.column("car", "car:year", "car:year");
        columns[3] = qomFactory.column("car", "car:userRating", "car:userRating");
View Full Code Here

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

        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");
        columns[2] = qomFactory.column("car", "car:year", "car:year");
        columns[3] = qomFactory.column("car", "car:userRating", "car:userRating");
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.