repository단에 동적 쿼리가 담긴 메소드를 작성한 후 잘 돌아가는지 테스트하려고 하는데 위와 같은 에러가 떴다.

 

알고보니 내가 동적으로 쿼리를 날리는 경우라면 NativeQuery를 True로 설정해야하는 것이다.

@Query(value = "select * from member_status where user_profile_idx = :userProfileIdx limit 1", nativeQuery = True)

다음과 같이 NativeQuery를 True로 선언해주니 바로 해결했다!

+ Recent posts