Spring 对多种 ORM 框架提供了很好的支
20 查阅
参考答案:
在 context 中定义 DataSource,创建 SessionFactoy,设置参数;DAO 类继承HibernateDaoSupport,实现具体接口,从中获得HibernateTemplate进行具体操作。在使用中如果遇到 OpenSessionInView 的问题,可以添加 OpenSessionInViewFilter 或OpenSessionInViewInterceptor。(详见Spring Framework 2.0 Reference的12.2节Hibe