Mysql语句是:select * from Product as p order by p.addtime desc limit 6
Hibernate的DAO类中的语句是:from Product as p order by p.addtime desc limit 6
select top 6 * from Product as p order by p.addtime desc
大概这样了hql,你测试下 不敢肯定对 反正基本和sql一样
注意hql是面向对象的
我记得hql应该有排序的关键字吧,就是order by desc/asc 我原来用的是sql server数据库,还没有用个mysql,如果不行,你就加几个技术群问问,那样还要快的多