Notice in this query we are selecting the version field. When iterating over the results, we will find that objects[1].getClass() will return Integer, rather than Long. The same seems to be true for the other supported types, except for Timestamp.
I will provide a full test in the next day or so.