Hibernate复习之Hibernate 映射关系

今日目录:

       1、Hibernate 一对一映射关系实现

       2、Hibernate 多对多映射关系实现

 

一、Hibernate 一对一映射关系实现

       1、按照主键映射;

Address.java

Address.hbm.xml

User.java

User.hbm.xml

2、按照外键映射;

Address2.java

Address2.hbm.xml

User2.java

User2.hbm.xml

UserTest.java

二、Hibernate 多对多映射关系实现

       1、多对多单向实现;

Course.java

Course.hbm.xml

Student.java

Student.hbm.xml

2、多对多双向实现

Course2.java

Course2.hbm.xml

Student2.java

Student2.hbm.xml

StudentTest.java

添加小编微信(y19970821ywty)可以获取工具,资源,二维码

要用到的工具,视频教程,关注公众号(Java学习之乐)直接免费获取:

猜你喜欢

转载自blog.csdn.net/wtyicy/article/details/81283881