一样的代码,例:(findOne(id))说我无法转换成相应的类型
Error:(24, 31) java: 无法将接口 org.springframework.data.repository.query.QueryByExampleExecutor<T>中的方法 findOne应用到给定类型;
需要: org.springframework.data.domain.Example<S>
找到: java.lang.Integer
原因: 无法推断类型变量 S
(参数不匹配; java.lang.Integer无法转换为org.springframework.data.domain.Example<S>)
以上是errors log
由于依赖的版本是2.0.6,所以会需要将findone(id)换成
ProductCategory productCategory = repository.findById(1).orElse(null);
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.6.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent>