我想找到所有具有相同工作的用户,但我收到错误:该位置的参数[1]不存在;嵌套异常是java.lang.IllegalArgumentException:该位置[1]的参数不存在
我的回购:
public interface AppUsersRepo extends CrudRepository<AppUsers,Integer> {
@Query("SELECT t FROM AppUsers t WHERE t.job = 'teacher'")
public List<AppUsers> findAllByJob(String job);
}
我的控制员:
public class MainController {
@Autowired
AppUsersRepo appRepo;
@RequestMapping("/")
public ModelAndView doHome() {
ModelAndView mv = new ModelAndView("index");
mv.addObject("lists",appRepo.findAll());
return mv;
}
@RequestMapping(value="/test")
public ModelAndView recoverPass() {
ModelAndView mv = new ModelAndView("test");
mv.addObject("lists",appRepo.findAllByJob());
return mv;
}
}