본문 바로가기
Error

Junit Error : NestedServletException : InvalidDataAccessResourceUsageException : QueryException

by 뽀또그링 2022. 12. 6.

 

에러 메세지

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not prepare statement; SQL [select enter0_.id as id1_2_, enter0_.room_id as room_id3_2_, enter0_.stay as stay2_2_, enter0_.user_id as user_id4_2_ from enter enter0_ where roomId=? and userId=?]; nested exception is org.hibernate.exception.SQLGrammarException: could not prepare statement

Caused by: java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: roomId of: shop.ggamf.ggamf.domain.enter.Enter [select e from shop.ggamf.ggamf.domain.enter.Enter e where e.roomId = :roomId and e.userId = :userId]

위 에러만 보고 대체 무슨 에러인가 .. 했는데

아래를 살펴보니 쿼리가 잘못 작성되어 있었다 !

 

 

 

 

 

해결

Repository에 작성했던 쿼리 확인하고 고쳐 작성했더니 해결 완료 :)