仅一条语句,求找错,好几天了(关于hql)
Java code
String hql = "from Article as a order by a.time desc where a.category.id=" + categoryId;
为什么,无论类别ID是多少,查出来的都是所有记录呢?
**后面用到了分页return queryForPage(hql, offset, length);
------解决方案--------------------
试试先where 后order by 呢
------解决方案--------------------order by 应该在语句的最后吧 !!!!