Throw an exception when generating a proxy class and the value for a
primary key is missing.