Inconsistent return types from JDO query


I'm running a JDO query which returns the sum of an int field.  The return type of the Object produced by the Query is inconsistent - sometimes Integer, sometimes Long.  Using setResultClass(Long.class) has no effect.


The type of a sum expression depends on the type of the field on which it works, but should be long for both int and long fields.

Please post the query and specify the relevant types.

ObjectDB Support

I am attaching sample code which reproduces the problem.


Thank you for this report and for the test. It shows that the sum of a single result uses the type of the original value rather than long as required. Build 2.5.6_01 fixes it.

ObjectDB Support

Excellent.  Thank you.