1、给工程加Spring capability;
a、选择Add checked Libraries to …… ,下一步
b、如果已有applicationContext.xml,选择Existing,否则选择New,下一步
c、在folder中选择bean包
2、给工程加Hibernate capability;
a、选择Add checked Libraries,下一步
b、选择Spring configuration file,下一步
c、选择Existing Spring configuration file,在SessionFactoryID中输入"sessionFactory",下一步
d、在Bean Id 中输dataSource,选择DB Profile
e、Create SessionFactory class 的选勾去掉。
3、切换到Hibernate视图
4、连接数据库,并选择表,点右键,选择Hibernate Reverse Engineering...
5、选择第一(Hibernate mapping file)和第二个选项(POJO),下一步
6、选择Java types,在ID Gernerator中选择indetity,下一步
7、在Class name中输入包名+类名,如 com.area.bean.Nexus,finash
a、选择Add checked Libraries to …… ,下一步
b、如果已有applicationContext.xml,选择Existing,否则选择New,下一步
c、在folder中选择bean包
2、给工程加Hibernate capability;
a、选择Add checked Libraries,下一步
b、选择Spring configuration file,下一步
c、选择Existing Spring configuration file,在SessionFactoryID中输入"sessionFactory",下一步
d、在Bean Id 中输dataSource,选择DB Profile
e、Create SessionFactory class 的选勾去掉。
3、切换到Hibernate视图
4、连接数据库,并选择表,点右键,选择Hibernate Reverse Engineering...
5、选择第一(Hibernate mapping file)和第二个选项(POJO),下一步
6、选择Java types,在ID Gernerator中选择indetity,下一步
7、在Class name中输入包名+类名,如 com.area.bean.Nexus,finash
Spring与Hibernate集成配置指南
本文详细介绍如何在项目中集成Spring与Hibernate框架。步骤包括添加依赖库、配置applicationContext.xml文件、创建SessionFactory及DataSource等。此外,还介绍了如何通过Hibernate进行数据库逆向工程并生成映射文件。
203

被折叠的 条评论
为什么被折叠?



