Examples of CompoundPredicate


Examples of cascading.pattern.model.tree.predicate.compound.CompoundPredicate

        return new NoArgPredicateInvoker( simplePredicate );
      else
        return new PredicateInvoker( simplePredicate, expectedFields.getPos( argumentField ) );
      }

    CompoundPredicate compoundPredicate = (CompoundPredicate) predicate;
    Predicate[] children = compoundPredicate.getChildren();

    Invoker[] invokers = new Invoker[ children.length ];

    for( int i = 0; i < children.length; i++ )
      invokers[ i ] = createInvokers( expectedFields, children[ i ] );
View Full Code Here

Examples of com.psddev.dari.db.CompoundPredicate

            }
        }

        private Predicate addPrefix(String prefix, Predicate predicate) {
            if (predicate instanceof CompoundPredicate) {
                CompoundPredicate compound = (CompoundPredicate) predicate;
                List<Predicate> children = new ArrayList<Predicate>();
                for (Predicate child : compound.getChildren()) {
                    children.add(addPrefix(prefix, child));
                }
                return new CompoundPredicate(compound.getOperator(), children);

            } else if (predicate instanceof ComparisonPredicate) {
                ComparisonPredicate comparison = (ComparisonPredicate) predicate;
                return new ComparisonPredicate(comparison.getOperator(),
                                              comparison.isIgnoreCase(),
View Full Code Here

Examples of net.floodlightcontroller.storage.CompoundPredicate

                {"Jose", "Garcia"},
                {"Abigail", "Johnson"},
                {"John", "McEnroe"}
        };
        IResultSet resultSet = storageSource.executeQuery(PERSON_TABLE_NAME, columnList,
                new CompoundPredicate(CompoundPredicate.Operator.AND, false,
                        new OperatorPredicate(PERSON_LAST_NAME, OperatorPredicate.Operator.GTE, "G"),
                        new OperatorPredicate(PERSON_LAST_NAME, OperatorPredicate.Operator.LT, "N")
                ),
                new RowOrdering(PERSON_SSN));
        checkExpectedResults(resultSet, columnList, expectedResults);
View Full Code Here

Examples of net.floodlightcontroller.storage.CompoundPredicate

                {"John", "Smith"},
                {"Lisa", "Jones"},
                {"Susan", "Jones"}
        };
        IResultSet resultSet = storageSource.executeQuery(PERSON_TABLE_NAME, columnList,
                new CompoundPredicate(CompoundPredicate.Operator.OR, false,
                        new OperatorPredicate(PERSON_LAST_NAME, OperatorPredicate.Operator.EQ, "Jones"),
                        new OperatorPredicate(PERSON_LAST_NAME, OperatorPredicate.Operator.EQ, "Smith")
                ),
                new RowOrdering(PERSON_SSN));
        checkExpectedResults(resultSet, columnList, expectedResults);
View Full Code Here

Examples of net.floodlightcontroller.storage.CompoundPredicate

        String[] columnList = {PERSON_FIRST_NAME,PERSON_LAST_NAME};
        Object[][] expectedResults = {
                {"Lisa", "Jones"}
        };
        IResultSet resultSet = storageSource.executeQuery(PERSON_TABLE_NAME, columnList,
                new CompoundPredicate(CompoundPredicate.Operator.AND, false,
                        new OperatorPredicate(PERSON_LAST_NAME, OperatorPredicate.Operator.EQ, "Jones"),
                        new OperatorPredicate(PERSON_FIRST_NAME, OperatorPredicate.Operator.EQ, "Lisa")
                ),
                new RowOrdering(PERSON_SSN));
        checkExpectedResults(resultSet, columnList, expectedResults);
View Full Code Here

Examples of net.floodlightcontroller.storage.CompoundPredicate

                {"Abigail", "Johnson", 35},
                {"Bjorn", "Borg", 55},
                {"John", "McEnroe", 53}
        };
        IResultSet resultSet = storageSource.executeQuery(PERSON_TABLE_NAME, columnList,
                new CompoundPredicate(CompoundPredicate.Operator.OR, false,
                        new OperatorPredicate(PERSON_AGE, OperatorPredicate.Operator.GTE, 35),
                        new OperatorPredicate(PERSON_FIRST_NAME, OperatorPredicate.Operator.EQ, "Lisa")
                ),
                new RowOrdering(PERSON_SSN));
        checkExpectedResults(resultSet, columnList, expectedResults);
View Full Code Here

Examples of net.floodlightcontroller.storage.CompoundPredicate

    NoSqlPredicate convertPredicate(IPredicate predicate, String tableName, Map<String,Comparable<?>> parameterMap) {
        if (predicate == null)
            return null;
        NoSqlPredicate convertedPredicate = null;
        if (predicate instanceof CompoundPredicate) {
            CompoundPredicate compoundPredicate = (CompoundPredicate)predicate;
            ArrayList<NoSqlPredicate> noSqlPredicateList = new ArrayList<NoSqlPredicate>();
            for (IPredicate childPredicate: compoundPredicate.getPredicateList()) {
                boolean incorporated = false;
                if (childPredicate instanceof OperatorPredicate) {
                    OperatorPredicate childOperatorPredicate = (OperatorPredicate)childPredicate;
                    for (NoSqlPredicate childNoSqlPredicate: noSqlPredicateList) {
                        incorporated = childNoSqlPredicate.incorporateComparison(
                                childOperatorPredicate.getColumnName(), childOperatorPredicate.getOperator(),
                                getOperatorPredicateValue(childOperatorPredicate, parameterMap),
                                compoundPredicate.getOperator());
                        if (incorporated)
                            break;
                    }
                }
                if (!incorporated) {
                    NoSqlPredicate noSqlPredicate = convertPredicate(childPredicate, tableName, parameterMap);
                    noSqlPredicateList.add(noSqlPredicate);
                }
            }
            convertedPredicate = new NoSqlCompoundPredicate(this, tableName,
                    compoundPredicate.getOperator(),
                    compoundPredicate.isNegated(), noSqlPredicateList);
        } else if (predicate instanceof OperatorPredicate) {
            OperatorPredicate operatorPredicate = (OperatorPredicate) predicate;
            Comparable<?> value = getOperatorPredicateValue(operatorPredicate, parameterMap);
            switch (operatorPredicate.getOperator()) {
            case EQ:
View Full Code Here

Examples of org.dmg.pmml.CompoundPredicate

        }
      }

    if( predicate instanceof CompoundPredicate )
      {
      CompoundPredicate compoundPredicate = (CompoundPredicate) predicate;

      List<cascading.pattern.model.tree.predicate.Predicate> predicates = new ArrayList<cascading.pattern.model.tree.predicate.Predicate>();

      for( Predicate child : compoundPredicate.getPredicates() )
        predicates.add( getPredicateFor( modelSchema, child ) );

      CompoundPredicate.BooleanOperator operator = compoundPredicate.getBooleanOperator();

      switch( operator )
        {
        case OR:
          return new OrPredicate( predicates );
View Full Code Here

Examples of org.hibernate.ejb.criteria.predicate.CompoundPredicate

  /**
   * {@inheritDoc}
   */
  public Predicate and(Expression<Boolean> x, Expression<Boolean> y) {
    return new CompoundPredicate( this, Predicate.BooleanOperator.AND, x, y );
  }
View Full Code Here

Examples of org.hibernate.ejb.criteria.predicate.CompoundPredicate

  /**
   * {@inheritDoc}
   */
  public Predicate or(Expression<Boolean> x, Expression<Boolean> y) {
    return new CompoundPredicate( this, Predicate.BooleanOperator.OR, x, y );
  }
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.