hibernate4+spring集成推荐用sessionFactory.getCurrentSession(),如果你自己想用HibernateTemplate,那你照着org.springframework.orm.hibernate3的那个写一个就行了。其实spring对hibernate4的集成方式我觉得更好,完全就是让我们自己更方便的使用泛型DAO等。并且你只要仔细研究HibernateTemplate的方法,你会发现其实HibernateTemplate在很多情况下都是多余的,因为hibernate本身已经做的够好了。希望我的回答对你有用。
如果是在applicationcontext。xml中配置的话,就不用修改该他了,已经用不到了啊,不过不知道你的的datasource是不是也在xml中配置,给你个例子看看自己调整吧
y2ssh/xmal/entity/goods.hbm.xml
y2ssh/xmal/entity/user.hbm.xml
y2ssh/xmal/entity/bid.hbm.xml
org.hibernate.dialect.sqlserverdialect
true