I would like to know how can we set a embedded primary key without annotations , it means with the mapping shadow files of hibernate ?
1 Answer
For Hibernate verion 4.1: In the documentation you find an example for what you want. Both XML and annotation is put there next to each other.
- 5.1.2.1.3. Multiple id properties with with a dedicated identifier type: @IdClass and corresponding XML mapping
- 5.1.2.1.1. id as a property using a component type: @EmbeddedId and corresponding XML mapping