With a object that is created via a save(), and the record's primary key is a INT fed by a SEQUENCE, the type of the variable is an INT.
With an object that is hydrated from the database via a SELECT, the record's primary key INT will come back in 'toArray()' as a STRING.
That means that checking for type has to know what context it came from, user, INSERT, or SELECT. Not fun.
This also screws up converting arrays to JSON, 'cause the STRINGS get quotation marks and the INTS do not.
As a general rule, everything FROM the database seems to be strings. Yes, I know, everything 'on the wire' or 'through a socket' comes out as text. And it's a lot faster to leave it that way.
But having the type be different depending on the database operation? Not sure I like that.