整合原理:將SessionFactory交給spring容器管理
在applicationContext.xml中配置
1.將SessionFactory配置到spring容器中去
<bean name="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
2.有兩種配置配置方式
①,仍然使用hibernate.cfg.xml配置信息
②在spring配置中放置hibernate的配置信息(推薦)