Page wrote:
I'm new to Hibernate so I feel some difficulties with mapping of these tables:
FORM {FORM_ID, DESCRIPTION,...},
QUESTION {QUESTION_ID, DESCRIPTION,...},
QUESTION_GROUP {GROUP_ID, DESCRIPTION,...},
FORM_QUESTION {FORM_ID, QUESTION_ID, GROUP_ID}
As you can see the last table is not business entity but relation table (FORM_ID & QUESTION_ID are Primary Key, GROUP_ID is FK).
How should I map my entities Form, Question & QuestionGroup? Should I create some 'FormQuestion' entity? I wouldn't like to do it..
If You do not create 'FormQuestion' entity, how would You gain access to Group_Id (in code)? In UML world, the FormQAuestion could be association class
Gert