Spring与Hibernate两种组合方式
Spring与Hibernate大致有两种组合方式,主要区别是一种是在Hibernate中的hibernate.cfg.xml中配置数据源,一种是借助Spring的jdbc方式在Spring的applicationContext.xml文件中配置数据源,然后在Spring配置sessionFactory的bean有些区别
第一种
1.hibernate.cfg.xml文件
2.在spring配置sessionFactory
或者实现hibernate零配置
第二种
或者实现hibernate的零配置
转与:http://developer.51cto.com/art/200906/131127.htm