Monday, February 18, 2013

A4- Why do we need a setter for the db-generated primary key?

Why do we need a setter for the db-generated primary key?


Think about what happens when you persist an object.  The primary key is set in the DB, but JPA needs the setter method to set the field in the object.  It will also need the setter method when deserializing a record to an object.

No comments:

Post a Comment