makes sure ids are always cast to strings

There seems to be some inconsistent Doctrine behavior when it comes to handling
ids of type "bigint". When re-reading from the database, they are strings, but
directly after insertions they are cast to integers. This can lead to problems
when performing shallow comparison for example with PHP's "===" operator.