ObjectDB ObjectDB

Issue #1556: Wrong type on SUM function

Type: Bug ReoprtVersion: 2.5.6Priority: NormalStatus: FixedReplies: 1
#1

Hello,

I have a problem when I run this aggregation query:

Query q = em.createQuery(
        "SELECT cc.totalCC.moneda, SUM(cc.totalCC.importe) FROM ComprobanteContable cc " +
        "WHERE cc.cuenta=:cuenta GROUP BY cc.totalCC.moneda");
List<Object[]> resultList = q.setParameter("cuenta", this).getResultList();

The problem is about SUM on cc.totalCC.importe, a BigDecimal field.
It works fine on all groups giving to me the correct sum BigDecimal value, except in one group that have only one object with a BigDecimal value that has no decimals, for this group it returns a Long type value instead a BigDecimal one.

Of course I have checked and all my objects have BigDecimal fields, so there is no reason to return a Long value.

Thank you.

 

edit
delete
#2

Thank you for this report. A fix is included in build 2.5.7_05.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.