Spring 整合 Hibernate
来源:互联网 发布:淘宝退款率高了怎么办 编辑:程序博客网 时间:2024/06/07 02:57
1. Spring 整合 Hibernate 整合什么 ?
1). 由 IOC 容器来管理 Hibernate 的 SessionFactory△
2). 让 Hibernate 使用上 Spring 的声明式事务
2. 整合步骤:
1). 加入 hibernate
①. jar 包
②. 添加 hibernate 的配置文件: hibernate.cfg.xml(有了△的操作后原来Hibernate一贯配置数据源的操作就不需要了只需要一些基本配置)
③. 编写了持久化类对应的 .hbm.xml 文件。
2). 加入 Spring
①. jar 包
②. 加入 Spring 的配置文件
3). 整合.(SpringIOC中的application中有<!-- 配置自动扫描的包 -->,<!-- 配置数据源 -->
<!-- 导入资源文件 -->
<!-- 配置 Hibernate 的 SessionFactory 实例:△ 通过 Spring 提供的 LocalSessionFactoryBean 进行配置 -->
<!-- 配置 Spring 的声明式事务 (名称换成了HibernateTransaction)-->
)
3. 编写代码
1). 由 IOC 容器来管理 Hibernate 的 SessionFactory△
2). 让 Hibernate 使用上 Spring 的声明式事务
2. 整合步骤:
1). 加入 hibernate
①. jar 包
②. 添加 hibernate 的配置文件: hibernate.cfg.xml(有了△的操作后原来Hibernate一贯配置数据源的操作就不需要了只需要一些基本配置)
③. 编写了持久化类对应的 .hbm.xml 文件。
2). 加入 Spring
①. jar 包
②. 加入 Spring 的配置文件
3). 整合.(SpringIOC中的application中有<!-- 配置自动扫描的包 -->,<!-- 配置数据源 -->
<!-- 导入资源文件 -->
<!-- 配置 Hibernate 的 SessionFactory 实例:△ 通过 Spring 提供的 LocalSessionFactoryBean 进行配置 -->
<!-- 配置 Spring 的声明式事务 (名称换成了HibernateTransaction)-->
)
3. 编写代码
0 0
- Spring:Spring整合Hibernate
- 【Spring】Spring+hibernate整合
- struts整合spring整合hibernate
- spring 整合hibernate整合方式
- 整合 struts spring hibernate
- struts+spring+hibernate整合
- struts,hibernate,spring整合
- struts+spring+hibernate整合
- struts+spring+hibernate整合
- Spring+hibernate+DWR整合
- webwork+spring+hibernate整合
- webwork+spring+hibernate整合
- Spring整合Hibernate
- Struts hibernate Spring 整合
- Struts hibernate Spring 整合
- Spring整合Hibernate
- 整合Spring、Struts、Hibernate
- webwork+spring+hibernate整合
- python tool
- 利用XSS钓鱼英语老师
- 为什么开通博客
- 自定义控件1
- centos分区方案
- Spring 整合 Hibernate
- OCR识别火车票(未实现,先记录)
- java 1.8新特性
- JAVA开发之 2-JRE与JDK及JVM的区别
- js,jsp页面传值的两种方式
- 常用Git命令清单
- Xcode8---ios9.2一下崩溃问题
- 前端加载自定义字体及速度优化
- 将时间字符串转换为另一种字符串