错误信息:
org.springframework.beans.NotWritablePropertyException: Invalid property 'sessionFactory' of bean class [dao.impl.UserDaoImpl]: Does the parameter type of the setter match the return type of the getter?
public SessionFactory getSessionFactory() {
return sessionFactory;
}
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
继承JdbcDaoSupport。
UserDaoImpl extends JdbcDaoSupport
方法2、
UserDaoImpl extends HibernateDaoSupport
用JdbcTempalte或HibernateTempalte操作数据库。
org.springframework.beans.NotWritablePropertyException: Invalid property 'sessionFactory' of bean class [dao.impl.UserDaoImpl]: Does the parameter type of the setter match the return type of the getter?
方法1、
在对应UserDaoImpl中加入sessionfactory的set方法、get方法。
private SessionFactory sessionFactory;public SessionFactory getSessionFactory() {
return sessionFactory;
}
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
继承JdbcDaoSupport。
UserDaoImpl extends JdbcDaoSupport
方法2、
UserDaoImpl extends HibernateDaoSupport
用JdbcTempalte或HibernateTempalte操作数据库。