I have a general question (simple, I hope) about hibernate mappings:
suppose, I have 3 tables:
test
testrun
testresult
"testresult" table is linked to "test" and "testrun" through foreign keys,
so it has a composite primary key consisting from 2 foreign keys.
I saw somewhere in the documentation that it is recommented to always create numeric primary key (ID) in every table for hibernate.
so, in this case "testresult" table would have "ID" primary key, and not "test_id & run_id".
would such a change improve/simplify development with Hibernate?
is it useful to modify the scheme to add this field in my case?
here's a quotation from the documentation:
Quote:
1.2.1. The first class
..........
The id property holds a unique identifier value for a particular event. All persistent entity classes (there are less important dependent classes as well) will need such an identifier property if we want to use the full feature set of Hibernate.