Search in sources :

Example 1 with ObjectWithBigDecimal

use of com.hazelcast.query.SampleObjects.ObjectWithBigDecimal in project hazelcast by hazelcast.

the class SqlPredicateTest method testSql_withBigDecimal.

@Test
public void testSql_withBigDecimal() {
    ObjectWithBigDecimal value = new ObjectWithBigDecimal(new BigDecimal("1.23E3"));
    assertSqlMatching("attribute > '" + new BigDecimal("1.23E2") + "'", value);
    assertSqlMatching("attribute >= '" + new BigDecimal("1.23E3") + "'", value);
    assertSqlNotMatching("attribute = '" + new BigDecimal("1.23") + "'", value);
    assertSqlMatching("attribute = '1.23E3'", value);
    assertSqlMatching("attribute = 1.23E3", value);
    assertSqlNotMatching("attribute = 1.23", value);
}
Also used : ObjectWithBigDecimal(com.hazelcast.query.SampleObjects.ObjectWithBigDecimal) BigDecimal(java.math.BigDecimal) ObjectWithBigDecimal(com.hazelcast.query.SampleObjects.ObjectWithBigDecimal) QuickTest(com.hazelcast.test.annotation.QuickTest) DateHelperTest(com.hazelcast.query.impl.DateHelperTest) Test(org.junit.Test)

Aggregations

ObjectWithBigDecimal (com.hazelcast.query.SampleObjects.ObjectWithBigDecimal)1 DateHelperTest (com.hazelcast.query.impl.DateHelperTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 BigDecimal (java.math.BigDecimal)1 Test (org.junit.Test)1