Spring data报错:Inferred type 'S' for type parameter 'S' is not within its bound;
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;相关推荐
- 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 ...
- 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 ...
- 数据库数据修改报错The instance of entity type ‘XXX‘ cannot be tracked
在数据库更新时, 1 首先查找数据库是否包含该项 2 然后更新该项目获添加, 在先查找的时候已经跟踪数据 第二步插入会报错The instance of entity type 'XXX' canno ...
- 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 ...
- 安装 sklearn 报错 ImportError: cannot import name Type
1. 安装 sklearn sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple sklearn 会默认安装 joblib , s ...
- 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 – ...
- SAP WM 自动创建TO单的JOB运行报错 - Enter the storage unit type - 对策
SAP WM 自动创建TO单的JOB运行报错 - Enter the storage unit type - 对策 报错如下: 详细信息: Log for automatic creation of ...
- python3运行报错:TypeError: Object of type ‘type‘ is not JSON serializable解决方法(详细)
python3运行报错:TypeError: Object of type 'type' is not JSON serializable解决方法(详细) 参考文章: (1)python3运行报错:T ...
- 解决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 ...
最新文章
- 微信公众号开发用书php,php微信公众号开发(3)php实现简单微信文本通讯
- android 触摸 卡顿,Android CoordinatorLayout(五) 严重的卡顿BUG
- php拆分数字字符串方法
- 如何防止同一账号多次登录
- 3 Curator框架实现分布式锁
- boost::hana::template_用法的测试程序
- 肽键肽链内部分的计算机术语大全,生化资料
- P3586-[POI2015]LOG【线段树】
- npoi excel 复制行_Excel的格式刷功能你真的会用吗?这样刷更加方便快捷
- 基于python 实现KNN 算法
- mysql在查询结果列表前添加一列递增的序号列(最简)
- 6个裂变获客增长方法
- 【CVPR华为】【CVPR诺亚方舟】【CVPR2019】华为诺亚方舟实验室2019年CVPR27篇:全面展现诺亚实验室在计算机视觉蓝图
- Uniapp打iOS离线包到出ipa安装思路
- 自动以管理员身份运行bat脚本
- 【易语言】微信跳一跳教程详细版,分分钟让新手学会的教程(附源码)
- 计算机开机连不上网,我家电脑有时候开机为什么连不上网,重启以后就好?
- 查看linux当前屏保文件夹,linux下屏保设置
- 怎么能快速的把pdf转换为word格式
- SpringBoot+Mybatis+Vue整合