The `JPA` (Java Persistence API) specification has 2 different ways to specify entity composite keys: `@IdClass` and `@EmbeddedId`.
I'm using both annotations on my mapped entities, but it turns out to be a big mess to people who aren't very familiar with `JPA`.
I want to adopt only one way to specify composite keys. Which one is really the best? Why?
以上就是Which annotation should I use: @IdClass or @EmbeddedId的详细内容,更多请关注web前端其它相关文章!