3
我想篩選JPA庫如何過濾JPA存儲庫?
@RequestMapping("/search")
public String search(@ModelAttribute Person search, Model model) {
PersonSpecifications spec = new PersonSpecifications();
model.addAttribute("people", this.hotelRepository.findAll(spec.lastNameIsLike("Foo")));
return "people/list";
}
而且得到了以下錯誤
The method findAll(Iterable<Long>) in the type CrudRepository<Person,Long> is not applicable for the arguments (Specification<Person>)
請指教。謝謝 !
謝謝!就是這樣。 – johnsam