Search in sources :

Example 11 with Condition

use of com.revolsys.record.query.Condition in project com.revolsys.open by revolsys.

the class QueryValueTest method testEqual.

private void testEqual() {
    final Condition trueCondition1 = Q.equal(this.idField, 10);
    assertConditionTrue(trueCondition1, this.record);
    final Condition trueCondition2 = Q.equal(this.idField, "10");
    assertConditionTrue(trueCondition2, this.record);
    final Condition falseCondition1 = Q.equal(this.idField, 11);
    assertConditionFalse(falseCondition1, this.record);
}
Also used : Condition(com.revolsys.record.query.Condition)

Example 12 with Condition

use of com.revolsys.record.query.Condition in project com.revolsys.open by revolsys.

the class QueryValueTest method testGreaterThan.

private void testGreaterThan() {
    final Condition trueCondition1 = Q.greaterThan(this.idField, 9);
    assertConditionTrue(trueCondition1, this.record);
    final Condition trueCondition2 = Q.greaterThan(this.idField, "9");
    assertConditionTrue(trueCondition2, this.record);
    final Condition falseCondition1 = Q.greaterThan(this.idField, 10);
    assertConditionFalse(falseCondition1, this.record);
}
Also used : Condition(com.revolsys.record.query.Condition)

Example 13 with Condition

use of com.revolsys.record.query.Condition in project com.revolsys.open by revolsys.

the class QueryValueTest method testGreaterThanEqual.

private void testGreaterThanEqual() {
    final Condition trueCondition1 = Q.greaterThanEqual(this.idField, 10);
    assertConditionTrue(trueCondition1, this.record);
    final Condition trueCondition2 = Q.greaterThanEqual(this.idField, "10");
    assertConditionTrue(trueCondition2, this.record);
    final Condition falseCondition1 = Q.greaterThanEqual(this.idField, 11);
    assertConditionFalse(falseCondition1, this.record);
}
Also used : Condition(com.revolsys.record.query.Condition)

Example 14 with Condition

use of com.revolsys.record.query.Condition in project com.revolsys.open by revolsys.

the class QueryValueTest method testLessThanEqual.

private void testLessThanEqual() {
    final Condition trueCondition1 = Q.lessThanEqual(this.idField, 10);
    assertConditionTrue(trueCondition1, this.record);
    final Condition trueCondition2 = Q.lessThanEqual(this.idField, "10");
    assertConditionTrue(trueCondition2, this.record);
    final Condition falseCondition1 = Q.lessThanEqual(this.idField, 9);
    assertConditionFalse(falseCondition1, this.record);
}
Also used : Condition(com.revolsys.record.query.Condition)

Example 15 with Condition

use of com.revolsys.record.query.Condition in project com.revolsys.open by revolsys.

the class QueryValueTest method testLessThan.

private void testLessThan() {
    final Condition trueCondition1 = Q.lessThan(this.idField, 11);
    assertConditionTrue(trueCondition1, this.record);
    final Condition trueCondition2 = Q.lessThan(this.idField, "11");
    assertConditionTrue(trueCondition2, this.record);
    final Condition falseCondition1 = Q.lessThan(this.idField, 10);
    assertConditionFalse(falseCondition1, this.record);
}
Also used : Condition(com.revolsys.record.query.Condition)

Aggregations

Condition (com.revolsys.record.query.Condition)40 BinaryCondition (com.revolsys.record.query.BinaryCondition)7 AbstractRecordLayer (com.revolsys.swing.map.layer.record.AbstractRecordLayer)6 Record (com.revolsys.record.Record)5 Query (com.revolsys.record.query.Query)5 RightUnaryCondition (com.revolsys.record.query.RightUnaryCondition)5 RecordDefinition (com.revolsys.record.schema.RecordDefinition)5 LayerRecord (com.revolsys.swing.map.layer.record.LayerRecord)5 ValueNode (com.akiban.sql.parser.ValueNode)2 ListByIndexIterator (com.revolsys.collection.list.ListByIndexIterator)2 AbstractMultiCondition (com.revolsys.record.query.AbstractMultiCondition)2 QueryWhereConditionField (com.revolsys.swing.field.QueryWhereConditionField)2 ArrayList (java.util.ArrayList)2 TreeMap (java.util.TreeMap)2 StandardException (com.akiban.sql.StandardException)1 BetweenOperatorNode (com.akiban.sql.parser.BetweenOperatorNode)1 BinaryArithmeticOperatorNode (com.akiban.sql.parser.BinaryArithmeticOperatorNode)1 BinaryLogicalOperatorNode (com.akiban.sql.parser.BinaryLogicalOperatorNode)1 BinaryOperatorNode (com.akiban.sql.parser.BinaryOperatorNode)1 CastNode (com.akiban.sql.parser.CastNode)1