How to create a generic entity model class that supports generic id including auto generated ids?
I have three kinds of primary keys for tables: INT auto generated primary key which use AUTO_INCREMENT capacity from database vendor (MySQL) CHAR(X) primary key to store a user readable value as key (where X is a number and 50 <= X <= 60) Complex primary keys, composed by 2 or 3 fields of the table. Also, there are some group of fields that may be present (or not): version, INT field. createdBy, VARCHAR(60) field, and lastUpdatedBy, VARCHAR(60) field (there are more fields but these covers a basic example). Some examples of above: Table1 id int primary key auto_increment version int value char