본문 바로가기
JPA

[JPA/ERROR] fetch join & DTO

by onejunu 2020. 8. 8.

https://stackoverflow.com/questions/12459779/query-specified-join-fetching-but-the-owner-of-the-fetched-association-was-not

 

query specified join fetching, but the owner of the fetched association was not present in the select list

I'm selecting two id columns but get error specified: org.hibernate.QueryException: **query specified join fetching, but the owner of the fetched association was not present in the select list** [

stackoverflow.com

 

에러 내용은 이렇다.

 

IllegalArgumentException: org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list

 

DTO를 이용해서 반환할때, fetch join 하면 나오는 에러.

 

join으로 바꾸면 해결됨.

댓글