在hibernate多表查询中,都出错,虽有执行
Hibernate: select article0_.aid as aid0_, article0_.tid as tid0_, article0_.uid as uid0_, article0_.title as title0_, article0_.content as content0_, article0_.exam as exam0_, article0_.blushtime as blushtime0_, article0_.readCount as readCount0_ from t_article article0_ 但是返回却是null。
DAO中实现
public List<Article> queryAll() throws Exception {
List<Article> list=(List<Article>) getHibernateTemplate().find("FROM Article");
if(list==null){
System.out.print("null list");
return null;
}
return list;
}
service层就调用,
Action层:
public String queryAll(){
try {
articleList=(List<Article>)articleService.queryAll();
} catch (Exception e) {
return "queryAllFail";
}
return "queryAllSuc";
}
总是返回queryAllFail 到错误页面。
希望大家帮忙解决!谢谢