public List<?> findAllProject(int rowsPerPage, int page) {//This method must return a result of type List<?>显示红线错误
Session session=null;
try {
session=HbSessionFactory.getSession();
Query query=session.createQuery("from Project");
query.setMaxResults(rowsPerPage);
query.setFirstResult(rowsPerPage*(page-1));
List<?> list=query.list();
return list;
} catch (HibernateException e) {
e.printStackTrace();
}finally{
HbSessionFactory.closeSession(session);
}
}
上面的错误该怎么解决?
Session session=null;
try {
session=HbSessionFactory.getSession();
Query query=session.createQuery("from Project");
query.setMaxResults(rowsPerPage);
query.setFirstResult(rowsPerPage*(page-1));
List<?> list=query.list();
return list;
} catch (HibernateException e) {
e.printStackTrace();
}finally{
HbSessionFactory.closeSession(session);
}
}
上面的错误该怎么解决?
Session session=null;
try {
session=HbSessionFactory.getSession();
Query query=session.createQuery("from Project");
query.setMaxResults(rowsPerPage);
query.setFirstResult(rowsPerPage*(page-1));
List <?> list=query.list();
return list;
} catch (HibernateException e) {
e.printStackTrace();
}finally{
HbSessionFactory.closeSession(session);
}
return null;
}
Session session=null;
List list = null;
try {
session=HbSessionFactory.getSession();
Query query=session.createQuery("from Project");
query.setMaxResults(rowsPerPage);
query.setFirstResult(rowsPerPage*(page-1));
list=query.list();
} catch (HibernateException e) {
e.printStackTrace();
}finally{
HbSessionFactory.closeSession(session);
}
return list;
}