spring 整合hibernate

1. Spring 整合 Hibernate 整合什么 ?

1). 有 IOC 容器来管理 Hibernate 的 SessionFactory
2). 让 Hibernate 使用上 Spring 的声明式事务

2. 整合步骤:

1). 加入 hibernate
①. jar 包
②. 添加 hibernate 的配置文件: hibernate.cfg.xml
③. 编写了持久化类对应的 .hbm.xml 文件。

2). 加入 Spring
①. jar 包
②. 加入 Spring 的配置文件

3). 整合.

3. 编写代码

posted on 2016-01-05 13:11  zoghin  阅读(85)  评论(0)    收藏  举报

导航