如上图,需要分页(图中未实现显示文件夹功能)
public List<myFiles> queryFile(final PageUtil pageUtil,final Integer del,final String fatherFolder) {
System.out.println("fatherFolder="+fatherFolder);
List<myFiles> list = new ArrayList<myFiles>();
list=getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Query query=session.createQuery("from myFiles f where f.del=:isdel and f.ff_id=:ffolder")
.setInteger("isdel",del)
.setString("ffolder", fatherFolder);
query.setFirstResult((pageUtil.getPageNo()-1)*pageUtil.getPageSize()).setMaxResults(pageUtil.getPageSize());
return query.list();
}
});
return list;
}
我现在只会查一张表,怎么同时查文件夹表呢?
文件与文件夹是同级的,所以无关联