Springboot JpaRepository findOne() 方法报错

findOne方法是findOne(Example<S> example) 返回Optional<S>,为什么我的findOne()方法会报错

原因是Springboot的版本问题,springboot2.0以下的版本都能良好的支持findOne(String id)方法,而springboot2.0及其以上版本就只有findOne(Example<S> example)方法,所以解决此问题的方法就是修改springboot的版本,在gradle工程里面修改build.gradle文件 ;在maven工程里修改pom.xml文件,


猜你喜欢

转载自blog.csdn.net/qq_41973729/article/details/80000511
今日推荐