When spring starts without Example
everything is fine, but with Example
the result is empty
Application.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> {
}
Service.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);
}
When without Example, it's work. svHistoryRep.findAll().forEach(System.out::println);
But with Example, i have empty result