Examples of BooleanCondition


Examples of com.stratio.cassandra.index.query.BooleanCondition

     * {@inheritDoc}
     */
    @Override
    public BooleanCondition build()
    {
        return new BooleanCondition(boost, must, should, not);
    }
View Full Code Here

Examples of org.eclipse.emf.query.conditions.booleans.BooleanCondition

    //  Boolean comparison methods
    // -----------------------------------------------------

    public static BooleanCondition eq(Boolean state) throws EFeatureEncoderException {
        isSane(state, "state", true);
        return new BooleanCondition(state);
    }
View Full Code Here

Examples of org.eclipse.emf.query.conditions.booleans.BooleanCondition

        return new BooleanCondition(state);
    }

    public static BooleanCondition ne(Boolean state) throws EFeatureEncoderException {
        isSane(state, "state", true);
        return new BooleanCondition(!state);
    }
View Full Code Here

Examples of org.jamesii.model.carules.reader.antlr.parser.BooleanCondition

        integer++;
      }
      map.put(s, integer);
    }

    AndExpression a = new AndExpression(new BooleanCondition(true));
    List<String> states = Arrays.asList(allStates);
    for (Entry<String, Integer> e : map.entrySet()) {
      int i = states.indexOf(e.getKey());
      a.addCondition(new StateCondition(i, e.getValue(), e.getValue()));
    }
View Full Code Here

Examples of org.jamesii.model.carules.reader.antlr.parser.BooleanCondition

        integer++;
      }
      map.put(s, integer);
    }

    AndExpression a = new AndExpression(new BooleanCondition(true));
    List<String> states = Arrays.asList(allStates);
    for (Entry<String, Integer> e : map.entrySet()) {
      int i = states.indexOf(e.getKey());
      a.addCondition(new StateCondition(i, e.getValue(), e.getValue()));
    }
View Full Code Here

Examples of org.ofbiz.sql.BooleanCondition

                    Joiner.OR,
                    GenericTestCaseBase.<Condition>list(
                        new ConditionList(
                            Joiner.AND,
                            list(
                                new BooleanCondition(new FieldValue("a", "partyTypeId"), "=", new StringValue("PERSON")),
                                new BooleanCondition(new FieldValue("b", "lastName"), "LIKE", new ParameterValue("lastName")),
                                new BetweenCondition(new FieldValue("b", "birthDate"), new StringValue("1974-12-01"), new StringValue("1974-12-31"))
                            )
                        ),
                        new ConditionList(
                            Joiner.AND,
                            list(
                                new ListCondition(new FieldValue("b", "partyId"), "IN", GenericTestCaseBase.<Value>list(
                                    new StringValue("1"),
                                    new StringValue("2"),
                                    new StringValue("3"),
                                    new StringValue("4")
                                )),
                                new BooleanCondition(new FieldValue("b", "gender"), "=", new StringValue("M"))
                            )
                        )
                    )
                ),
                new BooleanCondition(new FieldValue("b", "firstName"), "LIKE", new StringValue("%foo%")),
                null,
                list(
                    new OrderByItem(OrderByItem.Order.DEFAULT, OrderByItem.Nulls.DEFAULT, new FunctionCall("LOWER", GenericTestCaseBase.<Value>list(new FieldValue(null, "lastName")))),
                    new OrderByItem(OrderByItem.Order.DEFAULT, OrderByItem.Nulls.DEFAULT, new FieldValue(null, "firstName")),
                    new OrderByItem(OrderByItem.Order.DESCENDING, OrderByItem.Nulls.DEFAULT, new FieldValue(null, "birthDate"))
View Full Code Here

Examples of org.ofbiz.sql.BooleanCondition

        assertEquals(label + ":right", right, c.getRight());
        basicTest(label, BooleanCondition.class, c, s, o, matches);
    }

    public void testBooleanCondition() {
        BooleanCondition c1 = new BooleanCondition(l1, "=", l2);
        booleanConditionTest("c1", c1, l1, "=", l2, "1 = 5", null, false);
        BooleanCondition c2 = new BooleanCondition(l1, "=", l3);
        booleanConditionTest("c2", c2, l1, "=", l3, "1 = 10", c1, false);
        BooleanCondition c3 = new BooleanCondition(l1, "<", l2);
        booleanConditionTest("c3", c3, l1, "<", l2, "1 < 5", c1, false);
        BooleanCondition c4 = new BooleanCondition(l2, ">", l3);
        booleanConditionTest("c4", c4, l2, ">", l3, "5 > 10", c1, false);
        BooleanCondition c5 = new BooleanCondition(l1, "=", l2);
        booleanConditionTest("c5", c5, l1, "=", l2, "1 = 5", c1, true);
    }
View Full Code Here

Examples of org.ofbiz.sql.BooleanCondition

    }

    private static void conditionListTest(String label, ConditionList c, Joiner joiner, List<? extends Condition> conditions, String s, ConditionList o, boolean matches) {
        assertEquals(label + ":joiner", joiner, c.getJoiner());
        basicTest(label, ConditionList.class, c, s, o, matches);
        BooleanCondition b = new BooleanCondition(l1, "=", l3);
        c.add(b);
        assertEqualsIterable(label + ":iterable", conditions, Collections.<Condition>emptyList(), false, c, list(b), true);
    }
View Full Code Here

Examples of org.ofbiz.sql.BooleanCondition

        c.add(b);
        assertEqualsIterable(label + ":iterable", conditions, Collections.<Condition>emptyList(), false, c, list(b), true);
    }

    public void testConditionList() {
        BooleanCondition b1 = new BooleanCondition(l1, "=", l2);
        BooleanCondition b2 = new BooleanCondition(l2, "=", l3);
        ConditionList c1 = new ConditionList(Joiner.AND, GenericTestCaseBase.<Condition>list(b1));
        conditionListTest("c1", c1, Joiner.AND, list(b1), "( 1 = 5 )", null, false);
        ConditionList c2 = new ConditionList(Joiner.AND, GenericTestCaseBase.<Condition>list(b1, b2));
        conditionListTest("c2", c2, Joiner.AND, list(b1, b2), "( 1 = 5 AND 5 = 10 )", c1, false);
        ConditionList c3 = new ConditionList(Joiner.OR, GenericTestCaseBase.<Condition>list(b2, b1));
View Full Code Here

Examples of org.ofbiz.sql.BooleanCondition

public class EntityConditionPlanner implements ConditionPlanner<EntityCondition> {
    public EntityCondition parse(Condition condition, Map<String, ? extends Object> params) throws ParameterizedConditionException {
        if (condition == null) return null;
        if (condition instanceof BooleanCondition) {
            BooleanCondition bc = (BooleanCondition) condition;
            return EntityCondition.makeCondition(buildFieldValue(bc.getLeft()), EntityOperator.lookupComparison(bc.getOp()), buildValue(bc.getRight(), params));
        } else if (condition instanceof ConditionList) {
            ConditionList cl = (ConditionList) condition;
            List<EntityCondition> conditions = FastList.newInstance();
            for (Condition subCondition: cl) {
                conditions.add(parse(subCondition, params));
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.