S2SH框架,Dao继承HibernateDaoSupport后,引起sessionFactory的get、set方法异常:
public class UserDaoImpl extends HibernateDaoSupport implements UserDao {
private SessionFactory sessionFactory;
public SessionFactory getSessionFactory() {
return sessionFactory;
}
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
}
异常如下:不能重写方法
Multiple markers at this line
- Cannot override the final method from HibernateDaoSupport
- overrides
org.springframework.orm.hibernate3.support.HibernateDaoSupport.setSessionFactory
求大神们指教一下,这个sessionFactory不需要get、set方法吗?
------解决思路----------------------
异常信息已经提示很清楚了,子类就不用写sessionFactory的get、set方法,直接调用父类的,不就可以了吗。