Search in sources :

Example 6 with Condition

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

the class QueryValueTest method testIn.

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

Example 7 with Condition

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

the class QueryValueTest method testNotEqual.

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

Example 8 with Condition

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

the class QueryValueTest method testBetween.

private void testBetween() {
    final Condition trueCondition1 = Q.between(this.idField, 9, 10);
    assertConditionTrue(trueCondition1, this.record);
    final Condition trueCondition2 = Q.between(this.idField, 10, 10);
    assertConditionTrue(trueCondition2, this.record);
    final Condition trueCondition3 = Q.between(this.idField, 10, 11);
    assertConditionTrue(trueCondition3, this.record);
    final Condition trueCondition4 = Q.between(this.idField, 9, 10);
    assertConditionTrue(trueCondition4, this.record);
    final Condition falseCondition1 = Q.between(this.idField, 11, 12);
    assertConditionFalse(falseCondition1, this.record);
}
Also used : Condition(com.revolsys.record.query.Condition)

Example 9 with Condition

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

the class QueryValueTest method testAnd.

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

Example 10 with Condition

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

the class QueryValueTest method testNot.

private void testNot() {
    final Condition trueCondition1 = Q.not(Q.equal(this.idField, 11));
    assertConditionTrue(trueCondition1, this.record);
    final Condition falseCondition1 = Q.not(Q.equal(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