Hello, everybody!
First of all, I would like to say that I already posted this question in other forums:
https://forum.hibernate.org/viewtopic.php?f=1&t=1007832
http://forums.oracle.com/forums/thread.jspa?threadID=1997599&tstart=0
but as I haven't got any answer from there I'm posting it here too in the hope that I find one, as this is very important to me. This forum is my last hope.
In JPA 1.0 I could map the collection association to DocumentSubject (only accessible through the Document entity) like this:
In JPA 2.0 I can get rid of the DocumentSubjectId class, transform DocumentSubject in an @Embeddable and use the @ElementCollection annotation, like this:
So, my question is: what is the recommended to use in this case: relationships to entity classes, like in the first case, or collection of embedded classes, like the second case? Note that I will never access in my application the DocumentSubject separately from the Document class. It really belongs to the Document class. What would you use in JPA 2.0, and why?
Thank you in advance.
Marcos