Fix for automatically getting the identity of a newly inserted entity if it uses auto increment.