`

hibernate多对多关联映射(双项关联)

阅读更多
hibernate多对多关联映射(双项关联)user<--->role

映射规则:
<set name="users" table="t_user_role" order-by="userid">
<key column="roleid"/>
<many-to-many class="com.bjsxt.hibernate.User" column="userid"></many-to-many>
</set>
* table属性值必须和单向关联中的table属性值一致
* <key>标签中的column属性值必须和单向关联中的<many-to-many>中的column属性值一致
* <many-to-many>标签中的column必须和单向关联中的<key>标签中的column属性值一致
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics