We're updating the issue view to help you get more done. 

SQLQuery with comparison operators for types that equals and compareTo behave differently is wrongly optimized

Description

An error happens when a Comparable class implements the method compareTo() incompatible with equals(). As in BigDecimal: the method BigDecimal.equals() takes into account a number of leading zeros, whereas the method BigDecimal.compareTo() ignores leading zeros.

So if we have an object with 2.2 BigDecimal property
query:SQLQuery<TestDomainObject> query = new SQLQuery<>(TestDomainObject.class, "bgValue <= ? and bgValue >= ?", new BigDecimal("2.20"), new BigDecimal("2.20"))
will return nothing since it will intersect the range and use equal instead of compareTo == 0.

Workaround

None

Acceptance Test

None

Status

Assignee

Unassigned

Reporter

Ester Atzmon

Labels

None

Priority

Medium

SalesForce Case ID

12042

Fix versions

None

Commitment Version/s

None

Due date

None

Product

XAP

Edition

Open Source

Platform

All