springboot报错内容:
Inferred type ‘S’ for type parameter ‘S’ is not within its bound; should extends xxxxxx
或者
delete (com.zyk.blog.po.Type) in CrudRepository cannot be applied to Cjava.lang.Long)
出现这种情况是不要慌,这是spring boot版本所造成的
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);
二.在使用delete 方法时出现无法填入(id) 并且报出如下提示
delete (com.zyk.blog.po.Type) in CrudRepository cannot be applied to Cjava.lang.Long)
这是可以将代码改为