OneToMany+MapKeyJoinColumn对我不起作用,请提出我做错了什么。我正在使用JPA2.0+Hibernate3.6.1并想映射下表:上课:@EntitypublicclassQuestion{//idandotherfields@OneToMany(mappedBy="question",cascade=CascadeType.ALL)@MapKeyJoinColumn(name="language_id")privateMapstatements=newHashMap();}@EntitypublicclassStatement{@IdprivateLongid;
根据Hibernatedocumentation,如果我们想使用Map作为实体之间的关联,可以使用多个注释。医生说:Alternativelythemapkeyismappedtoadedicatedcolumnorcolumns.Inordertocustomizethemappinguseoneofthefollowingannotations:@MapKeyColumnifthemapkeyisabasictype.Ifyoudon'tspecifythecolumnname,thenameofthepropertyfollowedbyunderscorefollowedbyKE
根据Hibernatedocumentation,如果我们想使用Map作为实体之间的关联,可以使用多个注释。医生说:Alternativelythemapkeyismappedtoadedicatedcolumnorcolumns.Inordertocustomizethemappinguseoneofthefollowingannotations:@MapKeyColumnifthemapkeyisabasictype.Ifyoudon'tspecifythecolumnname,thenameofthepropertyfollowedbyunderscorefollowedbyKE