【发布时间】:2019-11-05 13:51:17
【问题描述】:
大家好,我正在使用 SpringBoot 和 Mysql 。当我尝试显示信息时出现此错误
我的控制器中有以下代码:
query did not return a unique result: 2; nested exception is javax.persistence.NonUniqueResultException: query did not return a unique result: 2
org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2; nested exception is javax.persistence.NonUniqueResultException: query did not return a unique result: 2
代码
@GetMapping("showdeveforma/{id}")
public String ShowDeveFormation(Model m , @PathVariable Long id)
{
Formation frm = frmreop.findById(id).get();
m.addAttribute("avis", srv.findByforma(frm));
return"ChefProjetAffichageAffectationDeveForma";
}
【问题讨论】:
标签: mysql spring hibernate spring-boot controller