实现类在继承hibernateDAOSupport 的时候,每次都要把hibernateTemplate对象注入一次,我想文下,如果直直接把对象hibernateTemplate注入到hibernateDAOSupport不就不用每次都注入了么?为什么不行? 麻烦讲的详细点!
你是说要注入sessionFactory吧,注入sessionFactory时会生成hibernateTemplate,
hibernateTemplate不用再注入了
是org.springframework.orm.hibernate.support.HibernateDaoSupport这个类么
hibernateTemplate不需要注入啊,直接getHibernateTemplate()