11-15 12:12
Recent Posts
Recent Comments
Tags
- mysql
- ํ์ด์
- ๋ฐ์ดํฐ๋ฒ ์ด์ค
- DB
- ICT
- ์คํฝ๋ ํ
- ์จ์ผ๋ํ
- API๋ง์ผํ๋ ์ด์ค
- Java
- appetizer
- RaspberryPi
- TSQL
- Spring
- API MarketPlace ๊ธ๋ก๋ฒ ์ํฌํฐ์ฆ
- ์กํ๊ณ
- ํ๋ก๋ณด๋ ธ
- python
- DATABASE
- linux
- ์๋์ด๋ ธ
- Naver Cloud
- ์๋ฐ
- ict๊ณต๋ชจ์
- ์ด๋ธ์
- ํ์ด์ฌ
- ํ์ด์๊ณต๋ชจ์
- ์คํฝ์ค๋น
- SQL
- ICT๋ฉํ ๋ง
- JOBํ๊ณ
- Today
- Total
miinsun
[JPA-DATA] Validation failed for query for method public abstract java.util.List ํด๊ฒฐ ๋ฐฉ๋ฒ ๋ณธ๋ฌธ
WebApp/Spring
[JPA-DATA] Validation failed for query for method public abstract java.util.List ํด๊ฒฐ ๋ฐฉ๋ฒ
miinsun 2022. 2. 27. 18:23๐ ์์ธ : @Query ์ฌ์ฉ
@Query(value = "SELECT * FROM place_keyword pk "+
"ORDER BY (CASE WHEN pk.keyword_id = :keyword THEN 1 ELSE 2 END)")
List<PlaceKeyword> findPlaceKeywordBykeyword(@Param(value = "keyword") int keyword);
โ ์๋ฌ
์์ ์ฝ๋๋ฅผ ์คํ์ํค๊ณ ์ ํ๋๋ฐ
์ด๋ฐ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ค...
@Query ์ด๋ ธํ ์ด์ ์ ์ฌ์ฉํด MySQL, Oracle ๋ฑ ๋ค์ดํฐ๋ธ ์ฟผ๋ฆฌ๋ฅผ ์ํํ๋ ค๋ฉด
์๋์ ๊ฐ์ด native Query ์์ฑ์ true๋ก ์ค์ ํด์ค์ผ ํ๋ค.
nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.dalc.one.repository.PlaceRepository.findAIPlaceList(int)!
๐ ํด๊ฒฐ ๋ฐฉ๋ฒ
@Query(value = "SELECT * FROM place_keyword pk "+
"ORDER BY (CASE WHEN pk.keyword_id = :keyword THEN 1 ELSE 2 END)", nativeQuery = true)
List<PlaceKeyword> findPlaceKeywordBykeyword(@Param(value = "keyword") int keyword);
'WebApp > Spring' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Spring] ๋ค์ด๋ฒ ๋ธ๋ก๊ทธ ๊ฒ์ API ์ฌ์ฉํ๊ธฐ (0) | 2022.02.18 |
---|---|
[Spring] API ํค ๊ด๋ฆฌํ๋ ๋ฐฉ๋ฒ (0) | 2022.02.18 |
[JPA] ORACLE JPA ์ํ์ค ์์ฑ ์ ์ฉ / ORA-02289: ์ํ์ค๊ฐ ์กด์ฌํ์ง ์์ต๋๋ค ํด๊ฒฐ ๋ฐฉ๋ฒ (0) | 2022.02.05 |
[JPA] ๋ณตํฉํค ์ค์ (0) | 2022.02.04 |
[Spring] ํ๊ธ ํ๋ผ๋ฏธํฐ ๊นจ์ง ํด๊ฒฐ ๋ฐฉ๋ฒ (0) | 2022.02.03 |
Comments