Add support for models where primary key is not Integer type

Goal is to target models with UUID as primary key type.
See tests as an example.