티스토리 뷰
Programming/Spring
[SPRING JPA] java.sql.SQLException: Unknown label Possible value
마음 부자 2022. 10. 18. 07:21반응형
[SPRING JPA] java.sql.SQLException: Unknown label Possible value
원인 : entity에 선언한 컬럼이 쿼리문에 빠진 경우이다.
내 경우에는 java.sql.SQLException: Unknown label seq, Possible value
@Query(value = "select device_id, column " +
"from test where device_id = :device_id ", nativeQuery = true)
List<TEST> findAllByDeviceId(String device_id);
요렇게 바꿔주니 해결되었다 ( 엔티티에 선언한 컬럼 seq 추가)
@Query(value = "select seq, device_id, column " +
"from test where device_id = :device_id ", nativeQuery = true)
List<TEST> findAllByDeviceId(String device_id);
반응형
'Programming > Spring' 카테고리의 다른 글
[java] 랜덤 문자열 생성하기 (0) | 2022.11.02 |
---|---|
[spring jpa] Space is not allowed after parameter prefix ':' (0) | 2022.10.19 |
[SPRING] 요소 유형 "update"의 콘텐츠는 "(include|trim|where|set|foreach|choose|if|bind)"과(와) 일치해야 합니다. (0) | 2022.05.20 |
[java] 문자열 연결 성능 (StringBuilder vs String.Concat vs + ) (0) | 2022.01.13 |
[eclipse] 개발하면서 유용하게 사용할 수 있는 단축키에요. 개발 시간 단축에 필수 (0) | 2021.01.03 |
댓글
반응형