Hibernate实现limit查询报错 :unexpected token: limit near line 1, column 33 [from pojo.Product p order by id limit ?,? ]

原因:

hibernate无法识别limit,  hql语句更不能这样写String hql="from Product p order by id limit ?,? ";

解决方法:

设置一个从第几条开始取,另一个是取的长度;

1 q.setFirstResult(start);
2 q.setMaxResult(count);

Hibernate实现limit查询报错 :unexpected token: limit near line 1, column 33 [from pojo.Product p order by id limit ?,? ]

 

 

 

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2021-07-03
  • 2021-11-21
  • 2021-08-31
  • 2022-01-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-05
  • 2022-12-23
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案