日期:2014-05-20 浏览次数:21175 次
List basicList = super.getRightBiz().findAllBasicDataByNoteId(-1);//查询所有基础数据
request.getSession().setAttribute("basicList", basicList);
public List findAllBasicDataByNoteId(int noteId) {
String hql = "from BasicData where 1=1";
//noteId 值为大于等于0时,根据上级目录ID查询
if(noteId>=0){
hql+=" and noteId ="+noteId;
}
return super.getBaseDao().findObject(hql);
}
public List findObject(String hql) {
try {
return super.getHibernateTemplate().find(hql);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}