I would do this only when you are reading data (not writing it). When you have a DB like oracle, you can have statements like
select DOKUMENT.*, ROWID from DOKUMENT
→ and thus, you can add this statement into the Hibernate mapping:
subsequently, you define all other columns as
When you use the reverse engineering Wizard, you can
- remove the composite-key tag,
- search and replace key-property for property and
- insert above line