ObjectDB returns Integer instead of Long when I select just ID, but just for some entities

190 Views Asked by At

Testing in ObjectDB explorer while running query:

SELECT FROM Post p
WHERE id=:id

with parameter id set to 3007120 gives me this result: Result for Post id 3007120

But running a query:

SELECT p.id FROM Post p
WHERE id=:id

with the same parameter id of 3007120 returns an integer. Result for a second query

The weird part is, other entities, stored at basically the same time, from exactly the same source, with the very same process, return Long and long respectively.

Checking the Database schema in ObjectDB explorer tells me that the field is supposed to be long. In my Entity class the field is annotated with just ID and has only standard get/set methods

 @Id private long id;

Tried whatever I could think of and just cant figure this one out.

EDIT: As an additional question, why does it say long - the primitive type, when I retrieve the whole Entity but shows Long/Integer when i retrieve just the id?

0

There are 0 best solutions below