Inferred type 'S' for type parameter 'S' is not within its bound

springboot报错内容:
Inferred type ‘S’ for type parameter ‘S’ is not within its bound; should extends xxxxxx

/*

  1. * 根据id查询
  2. */
  3. @GetMapping("/student/{id}")
  4. public Student findById(@PathVariable("id") Integer id){
  5. return studentRespository.findOne(id);
  6. }

用以上方法findOne(id);报错,经过网上查询资料最后找到原因。解决办法如下,
1、springboot 版本问题,将 2.0.1 版本换成 1.5.4 版本。
2、将studentRespository.findOne(id); 改为 studentRespository.findById(id).orElse(null);
3、将studentRespository.findOne(id); 改为
return studentRespository.findById(id).get();
4、将studentRespository.findOne(id); 改为
return studentRespository.getOne(id);
以上三种办法,第二、三种方法本人试验过可以使用,第一种本人没进行验证,如有需要可以自行验证。第四种方法进行验证因为jdk版本原因并未成功,所有推荐大家使用第二三种方法。

以上均来自个人验证。

Inferred type 'S' for type parameter 'S' is not within its bound

标签:ppi   版本问题   ext   student   jdk   使用   方法   param   app

原文地址:https://www.cnblogs.com/ming-blogs/p/10288954.html

Inferred type 'S' for type parameter 'S' is not within its bound相关推荐

  1. SpringBoot:Inferred type 'S' for type parameter 'S' is not within its bound

    在使用springboot 方法报错: Inferred type 'S' for type parameter 'S' is not within its bound; should extends ...

  2. 【Mybatis-Plus】【异常】Inferred type ‘E‘ for type parameter ‘E‘ is not within its bound;

    问题描述 今天继承Mybatis-Plus里面的BaseMapper做的Dao层接口,实现selectPage()方法,但是一直报异常,代码和报错信息如下: @Service public class ...

  3. 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.springframewo ...

  4. Inferred type S for type parameter S is not within its bound

    springboot报错内容: Inferred type 'S' for type parameter 'S' is not within its bound; should extends xxx ...

  5. 使用SpringBoot报错:Inferred type ‘S‘ for type parameter ‘S‘ is not within its bound。【解决办法】

    ❌一.错误展示 使用SpringBoot时出现如下错误: Inferred type 'S' for type parameter 'S' is not within its bound 错误代码: ...

  6. 2、Inferred type ‘S‘ for type parameter ‘S‘ is not within its bound; should extend ‘com.yummy.sell.da

    2.Inferred type 'S' for type parameter 'S' is not within its bound; should extend 'com.yummy.sell.da ...

  7. Failed to register Grid Infrastructure type ora.mdns.type

    安装11g的集群软件的时候,在最后运行root.sh脚本时候,没有执行成功,最后提示如下错误: [root@r2 ~]# /u01/app/11.2.0/grid_1/root.sh Performi ...

  8. FutureWarning: Passing (type, 1) or ‘1type‘ it will be understood as (type, (1,)) / ‘(1,)type‘

    FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version ...

  9. Maven报错解决:Element 'dependency' cannot have character [children], because the type's content type is

    在用maven的时候遇到报错: Element 'dependency' cannot have character [children], because the type's content ty ...

最新文章

  1. Traceback (most recent call last)AttributeError: ‘NumpyArrayIterator‘ object has no attribute ‘ndim‘
  2. Web前端:11个让你代码整洁的原则
  3. wordpress 添加小工具分类
  4. java字符串匹配dp_[OI]字符串DP小结
  5. c语言随机读写信息fetch,北京大学信息科学技术学院考试试卷-计算机系统导论-期中-2015(16页)-原创力文档...
  6. 双系统 android 华硕,华硕发布Duet TD300,首款真正Windows+安卓双系统笔记本
  7. 安卓使用Audio Record自定义录音
  8. 学号 20165329 《Java程序设计》第4周学习总结
  9. CentOS6.7 i686上安装JDK7
  10. [状压dp][BZOJ3717][PA2014]Pakowanie
  11. RK3288方案开发,RK3288开发板方案,RK3288平板芯片参数资料
  12. Instagram 涨粉攻略2020 --我是如何7天从0到1000
  13. 使用poi替换ppt文件内的变量参数,包含ppt和pptx格式
  14. Scrum立会报告+燃尽图(Beta阶段第二周第五次)
  15. JavaScript入门学习指南
  16. linux创建用户,添加及修改shell
  17. wgs84坐标格式转换度分秒_使用ArcGIS实现WGS84经纬度坐标到北京54高斯投影坐标的转换...
  18. 啥是老北京涮羊肉,身在南方的北方人需要记得……
  19. BDF 字体文件格式(转)
  20. java轩辕剑怎么继承存档_轩辕剑外传:穹之扉-模型提取及导入图文教程

热门文章

  1. Linux之禅道安装
  2. sendcloud php 群发,laravel sendcloud发送邮件
  3. android5.0 应用闪退,【Android】MultiDex;NoClassDefFoundError;5.0以下系统应用闪退
  4. 统计学三大相关系数之Pearson相关系数、Spearman相关系数
  5. ESP8266-SPI通讯连接显示屏
  6. AI算法之Encoder-Decoder 和 Seq2Seq
  7. Exp1 PC平台逆向破解 20164302 王一帆
  8. cf卡,mmc卡,sd卡,sm卡,xd卡,记忆棒的区别是什么?
  9. sci国外期刊投稿过程(已完结)
  10. 三角形,斜线,表头css实现方法