Home Query did not return a unique result
Post
Cancel

Query did not return a unique result

query did not return a unique result:

해당 오류는 Repository에서 Return 값을 Class로 받아 담을 수가 없어서 에러가 발생한 것이다.

Repository의 Return 타입을 Class에서 List<Class> 로 받아주면 해결된다.

1
2
3
// Commnet findAllByRegistry_Idx(Long idx);
List<Comment> findAllByRegistry_Idx(Long idx);



reference
JPA query did not return a unique result 에러 해결방법

This post is licensed under CC BY 4.0 by the author.