在练习 Spring Data JPA 时,使用分页接口 Pageable 查询数据,接口实现后,运行报错:

Paging query needs to have a Pageable parameter! Offending method public abstract

实现代码摘要:

import org.springframework.data.domain.Page;
import java.awt.print.Pageable
...
@Service
public class AyUserServiceImpl implements AyUserService {
@Resource
private AyUserRepository ayUserRepository;
...
@Override
public Page<AyUser> findAll(Pageable pageable){
return ayUserRepository.findAll(pageable);
}
}

后来发现,Pageable 的包名不对,改成了

import org.springframework.data.domain.Pageable;

运行就正常了

参考https://segmentfault.com/q/1010000008968442

JpaRepository:Paging query needs to have a Pageable parameter! Offending method public abstract的更多相关文章

  1. Validation failed for query for method public abstract boxfish.bean.Student boxfish.service.StudentServiceBean.find(java.lang.String)!

    转自:https://blog.csdn.net/lzx925060109/article/details/40323741 1. Exception in thread "main&quo ...

  2. mybatis使用map传递多参数报错:A query was run and no Result Maps were found for the Mapped Statement

    在使用mybatis进行多参数传递时,报错: A query was run and no Result Maps were found for the Mapped Statement 'xx.xx ...

  3. mybatis报错:A query was run and no Result Maps were found for the Mapped Statement、、Property [login_ip] not found on type [com.thinkgem.jeesite.common.permission.entity.PremissUser]问题解决

    今天在做ssm项目的时候出现了: 先是出现 了错误: mybatis报错:A query was run and no Result Maps were found for the Mapped St ...

  4. 报错:System.NotSupportedException: LINQ to Entities does not recognize the method

    报错:System.NotSupportedException: LINQ to Entities does not recognize the method ...... get_Item(Int3 ...

  5. windows下Redis主从复制配置(报错:Invalid argument during startup: unknown conf file parameter : slaveof)

    主从复制配置中的遇到的异常: Invalid argument during startup: unknown conf file parameter :  slaveof 把Redis文件夹复制两份 ...

  6. AOP拦截日志类,抛异常:java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode

    AOP的日志拦截类中,抛出异常: java.lang.IllegalStateException: It is illegal to call this method if the current r ...

  7. Jetpack系列:Paging组件帮你解决分页加载实现的痛苦

    相信很多小伙伴们在项目实战中,经常会用到界面的分页显示.加载更多等功能.需要针对具体功能做针对性开发和调试,耗时耗力. Paging组件的使用将这部分的工作简化,从而让开发者更专注于业务的具体实现.下 ...

  8. FunDA(1)- Query Result Row:强类型Query结果行

    FunDA的特点之一是以数据流方式提供逐行数据操作支持.这项功能解决了FRM如Slick数据操作以SQL批次模式为主所产生的问题.为了实现安全高效的数据行操作,我们必须把FRM产生的Query结果集转 ...

  9. MySQL的错误:No query specified

    在做MySQL主从同步的时候通过: mysql> show slave status\G; *************************** 1. row **************** ...

  10. lr数据库参数化取数:The query result is empty and same is the parameter file问题原因

    出现这个问题的原因: 是因为我们的查询结果存在中文 如果查询结果没有中文,显示正常 解决办法: 新建一个数据源: 重新再选择这个数据源,再次查询: 说明不是连接字符串的问题或者是mysql驱动的问题 ...

随机推荐

  1. linux diff求两个文件的差集

    awk 从文本中过滤出需要的ip queryId_20231109214653_ipBatchQueryResult.json {"id":0,"ip":&qu ...

  2. C++ 中 Concept-Model 概念模型

    此文档参考自:https://gracicot.github.io/conceptmodel/2017/09/13/concept-model-part1.html ,觉得很有趣,就翻译过来了 一.C ...

  3. oracle中commit之后如何进行回滚

    commit之后 第一种: 记住大概的时间,获取前大概时间的数据. select * from Test as of timestamp to_timestamp('2021-12-08 09:30: ...

  4. String.split()遇到空字符串不解析的情况

    1.split的api说明 stringObj.split([separator,[limit]]) stringObj:要被分解的 String separator:字符串或正则表达式对象 limi ...

  5. 如何模拟HTTP请求并验证功能

    要模拟HTTP请求并验证功能,你可以使用Spring Boot提供的MockMvc工具,它允许我们在没有实际启动HTTP服务器的情况下测试Spring MVC控制器.以下是一个使用MockMvc进行H ...

  6. vue2遇到的一些错误

    一.VUE中的VUEX如何调用modules里面的mutations和state   ...mapMutations("workflow",['setApproverConfig' ...

  7. uniapp android app 铃声静音,真正的免打扰

    需要加入这个权限: <uses-permission android:name=\"android.permission.ACCESS_NOTIFICATION_POLICY\&quo ...

  8. go append的坑

    b := []int{1,2,3,4,5} slice := b[:2] newSlice := append(slice, 50) fmt.Println(b) fmt.Println(newSli ...

  9. 从Newtonsoft.Json迁移到 System.Text.Json不简单

    一.写在前面# System.Text.Json 是 .NET Core 3 及以上版本内置的 Json 序列化组件,刚推出的时候经常看到踩各种坑的吐槽,现在经过几个版本的迭代优化,提升了易用性,修复 ...

  10. UIView AutoLayout WrapContent,UIview 实现自动包裹

    一.需求 实现一个UI组件,要求组件内部的内容变化的时候,内容需要同时产生变化 二.实现 效果: 一个三个元素的组件,两边固定大小,中间的Label内容会变化 实现的约束: 首先保证三个元素同时居中, ...