Inconsistent return types from JDO query

#1

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.

#2

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
#3

I am attaching sample code which reproduces the problem.

#4

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
#5

Excellent.  Thank you.

Reply