当春天开始没有Example
一切都很好,但Example
结果是空的
应用程序.java
@SpringBootApplication
public class SelkinApplication {
public static void main(String[] args) {
SpringApplication.run(SelkinApplication.class, args);
}
}
SvHistoryRep.java
public interface SvHistoryRep extends CrudRepository<SvHistory, Integer>, QueryByExampleExecutor<SvHistory> {
}
服务.java
@PostMapping(path = "getFilteredHistory")
public @ResponseBody void getFilteredHistory(@RequestBody SvHistory svHistory){
SvHistory history = new SvHistory();
history.setJobStatusId(1);
Example<SvHistory> example = Example.of(history);
svHistoryRep.findAll(example).forEach(System.out::println);
}
没有示例时,它的工作。svHistoryRep.findAll().forEach(System.out::println);
但是对于示例,我的结果为空