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文件, 。