1  单方一对多

xml    one-to-many 配置

实体类    一方添加保存多方集合

 

 

2  单方多对一

xml    many-to-one 配置

实体类    多方添加保存一方引用

 

 

3  常用属性

inverse:设置哪一方维护关联关系

cascade:设置级联关系

 

posted on 2018-07-27 11:25  菜鸟乙  阅读(103)  评论(0编辑  收藏  举报