ObjectDB ObjectDB

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.

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

I am attaching sample code which reproduces the problem.

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

Excellent.  Thank you.

edit
delete

Reply

To post on this website please sign in.