Spring data报错:Inferred type ‘S’ for type parameter ‘S’ is not within its bound;


参照 org.springframework.data.repository.query.QueryByExampleExecutor 源码:

findOne:

/*** Returns a single entity matching the given {@link Example} or {@literal null} if none was found.** @param example must not be {@literal null}.* @return a single entity matching the given {@link Example} or {@link Optional#empty()} if none was found.* @throws org.springframework.dao.IncorrectResultSizeDataAccessException if the Example yields more than one result.*/
<S extends T> Optional<S> findOne(Example<S> example);

参照 org.springframework.data.repository.CrudRepository 源码:
findById:

/*** Retrieves an entity by its id.* * @param id must not be {@literal null}.* @return the entity with the given id or {@literal Optional#empty()} if none found* @throws IllegalArgumentException if {@code id} is {@literal null}.*/
Optional<T> findById(ID id);

findOne(id)findById(id).orElse(null) 替换即可。

Spring data报错:Inferred type 'S' for type parameter 'S' is not within its bound;相关推荐

  1. SAP VLPOD 报错 - Update control of movement type is incorrect (entry 107 X X E B _ E) - 之对策

    SAP VLPOD 报错 - Update control of movement type is incorrect (entry 107 X X E B _ E) - 之对策 如下的DN 8002 ...

  2. mybatis项目启动报错 The content of element type resultMap must match (constructor?,id*,result*,associat...

    启动项目报错 2018-02-26 17:09:51,535 ERROR [org.springframework.web.context.ContextLoader] - Context initi ...

  3. 数据库数据修改报错The instance of entity type ‘XXX‘ cannot be tracked

    在数据库更新时, 1 首先查找数据库是否包含该项 2 然后更新该项目获添加, 在先查找的时候已经跟踪数据 第二步插入会报错The instance of entity type 'XXX' canno ...

  4. ENVI对LandSat8 (OLI)图像 FLAASH大气校正 input radiance image data 报错 no valid data encountered in this file

    问题描述:用ENVI5.3.1对LandSat8 (OLI)图像 FLAASH大气校正 input radiance image data 报错 no valid data encountered i ...

  5. 安装 sklearn 报错 ImportError: cannot import name Type

    1. 安装 sklearn sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple sklearn 会默认安装 joblib , s ...

  6. SAP SD VL02N对STO的交货单执行PGI,报错 -Fld selectn for mvmt type 643 acct 400020 differs for Business Area –

    SAP SD VL02N对STO的交货单执行PGI,报错 -Fld selectn for mvmt type 643 acct 400020 differs for Business Area – ...

  7. SAP WM 自动创建TO单的JOB运行报错 - Enter the storage unit type - 对策

    SAP WM 自动创建TO单的JOB运行报错 - Enter the storage unit type - 对策 报错如下: 详细信息: Log for automatic creation of ...

  8. python3运行报错:TypeError: Object of type ‘type‘ is not JSON serializable解决方法(详细)

    python3运行报错:TypeError: Object of type 'type' is not JSON serializable解决方法(详细) 参考文章: (1)python3运行报错:T ...

  9. 解决Spring Boot报错Mapped Statements collection already contains value for...Error while adding the mapp

    解决Spring Boot报错Mapped Statements collection already contains value for...Error while adding the mapp ...

最新文章

  1. 微信公众号开发用书php,php微信公众号开发(3)php实现简单微信文本通讯
  2. android 触摸 卡顿,Android CoordinatorLayout(五) 严重的卡顿BUG
  3. php拆分数字字符串方法
  4. 如何防止同一账号多次登录
  5. 3 Curator框架实现分布式锁
  6. boost::hana::template_用法的测试程序
  7. 肽键肽链内部分的计算机术语大全,生化资料
  8. P3586-[POI2015]LOG【线段树】
  9. npoi excel 复制行_Excel的格式刷功能你真的会用吗?这样刷更加方便快捷
  10. 基于python 实现KNN 算法
  11. mysql在查询结果列表前添加一列递增的序号列(最简)
  12. 6个裂变获客增长方法
  13. 【CVPR华为】【CVPR诺亚方舟】【CVPR2019】华为诺亚方舟实验室2019年CVPR27篇:全面展现诺亚实验室在计算机视觉蓝图
  14. Uniapp打iOS离线包到出ipa安装思路
  15. 自动以管理员身份运行bat脚本
  16. 【易语言】微信跳一跳教程详细版,分分钟让新手学会的教程(附源码)
  17. 计算机开机连不上网,我家电脑有时候开机为什么连不上网,重启以后就好?
  18. 查看linux当前屏保文件夹,linux下屏保设置
  19. 怎么能快速的把pdf转换为word格式
  20. SpringBoot+Mybatis+Vue整合

热门文章

  1. 阿里云直播生成推流和播流地址类
  2. 老王出品:一文读懂证券业第三方存管和证券托管模式
  3. 12306个人敏感信息泄露
  4. 写专利的一点小小心得
  5. 电子工程师除了挣工资,还可以这样增加收入!
  6. 【阿里云】处理Centos7里面的阿里云盾
  7. 前端实现对象数组的关键字搜索
  8. 图灵机跟现实电子计算机哪个计算能力强,计算机不是只会“计算”,图灵机也不是一台“机器”|AI那厮...
  9. 关于脑电波的黑科技,离我们生活还有多远。
  10. 如何把照片制作成带音乐的影集相册?动感特效,简单实用!