Hi all!
Can anyone explain the difference between the two annotations @IdClass/@Id and @Embeddable/@EmbeddableId. When shall I use @IdClass and when shall I use @EmbeddedId?
Does anyone of you have a good answer to this? I would really appreciate your help to make me understand what decision to take in different situations.
Best Regards
/Oskar
IMHO @EmbeddedId should be used when the combined pk is either a meaningful entity itself or it reused in your code.
@IdClass is useful to specify that some combination of fields is unique but these do not have a special meaning.
Regards
Felix