SpringBootLearning icon indicating copy to clipboard operation
SpringBootLearning copied to clipboard

dao.findOne(id)版本兼容issue

Open Asucanc opened this issue 6 years ago • 1 comments

jpa getAccountById 在更高版本中 findOne(id) 不对, 替换为 findById(id).get();

Asucanc avatar Mar 05 '19 09:03 Asucanc

由于springboot的版本更新(我的2.2.4),这个地方可以改为如下参考: @RequestMapping(value = "/find", method = RequestMethod.PUT) public Optional<AccountJpa> getAccountById(@RequestParam(value = "id", required = true) int id) { return accountJpaDao.findById(id); }

peak-chen avatar Feb 19 '20 07:02 peak-chen