I have a hibernate file,like follows:
Code:
@Repository
public class SqlDao<T>{
@Autowired
private SessionFactory sessionFactory;
public SessionFactory getSessionFactory() {
return sessionFactory;
}
@Autowired
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
private Session getCurrentSession() {
return sessionFactory.getCurrentSession();
}
public Serializable save(T o) {
return this.getCurrentSession().save(o);
}
}
Then I call it like follows:
Code:
@Resource
SqlDao sqlDao;
MyObject m;
m.setId2("test");
sqlDao.save(m);
When I compile it,it raise following warning:
[javac] Demo.java:64: Warning: [unchecked] Original Type SqlDao member save(T) called without examined
[javac] sqlDao.save(folder);
[javac] ^
[javac] T is Type variable:
[javac] T expand the Object of Class SqlDao
[javac] 1 Warning
Why raise above error? How to correct it?