如何映射?
public class Survey {
long id;
Map<Question, Answer> questionnaire; ...
我想要的是有一张桌子(比如QUESTIONNAIRE) 这将承担三个ID(SURVEY_ID,QUESTION_ID,ANSWER_ID)
答案 0 :(得分:0)
<map name="questionnaire" table="QUESTIONNAIRE">
<key column="SURVEY_ID" />
<index-many-to-many class="...Question" column="QUESTION_ID" />
<one-to-many class="...Answer" column="ANSWER_ID" />
</map>