Spring3.1去掉了HibernateDaoSupport类。hibernate4需要通过getCurrentSession()获取session。并且设置org.springframework.orm.hibernate4.SpringSessionContext(在hibernate3的时候是thread和jta)。缓存设置改为net.sf.ehcache.hibernate.EhCacheProviderorg.hibernate.cache.ehcache.EhCacheRegionFactorySpring对hibernate的事务管理,不论是注解方式还是配置文件方式统一改为:getCurrentSession()事务会自动关闭,所以在有所jsp页面查询数据都会关闭session。要想在jsp查询数据库需要加入:org.springframework.orm.hibernate4.support.OpenSessionInViewFilter过滤器。Hibernate分页出现ResultSetmayonlybeaccessedinaforwarddirection需要设置hibernate结果集滚动false【引自9336703】
角求第三边;已知三边求角。) 用反三角