Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JPQL For queries with named parameters you need to use provide names for method parameters #5

Open
yunyoung1819 opened this issue Jun 28, 2023 · 0 comments
Assignees
Labels
bug Something isn't working JPQL

Comments

@yunyoung1819
Copy link
Owner

yunyoung1819 commented Jun 28, 2023

상황

  • 애플리케이션 로그에서 아래와 같은 로그가 출력되면서 에러가 발생
For queries with named parameters you need to use provide names for method parameters. 
Use @Param for query method parameters, or when on Java 8+ use the javac flag -parameters

원인

@Query(value = "select v from VillageArea v where ST_Contains(v.villagePolygon, :point)")
Optional<VillageArea> findVillageByLocationPoint(Point point);

해결

  • 파라미터에 스프링 데이터가 제공하는 @param("point") Point point 을 추가
@Query(value = "select v from VillageArea v where ST_Contains(v.villagePolygon, :point)")
Optional<VillageArea> findVillageByLocationPoint(@Param("point") Point point);

참고

@yunyoung1819 yunyoung1819 added bug Something isn't working JPQL labels Jun 28, 2023
@yunyoung1819 yunyoung1819 self-assigned this Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working JPQL
Projects
None yet
Development

No branches or pull requests

1 participant