扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
CustomerRepository.java
成都创新互联是一家专注于网站设计制作、成都网站设计与策划设计,凤台网站建设哪家好?成都创新互联做网站,专注于网站建设10多年,网设计领域的专业建站公司;建站业务涵盖:凤台等地区。凤台做网站价格咨询:18982081108
@Query(nativeQuery = true, value = "select * from adm_sys_customer ORDER BY ?#{#pageable}", countQuery = "select count(*) from adm_sys_customer") PagefindAllByPageable(Pageable pageable);
CustomerServiceImpl.java
//调用自定义sql PagepageObjectList = customerRepos.findAllByPageable(pageService.getPageable(1, 1, null));
ORDER BY ?#{#pageable} 必须加,否则报错:
Caused by: org.springframework.data.jpa.repository.query.InvalidJpaQueryMethodException:
Cannot use native queries with dynamic sorting and/or pagination in ...
参考:https://www.cnblogs.com/jiangxiaoyaoblog/p/5635152.html
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流