DB: PostgreSQL 14? 16?
SpringBoot: 2.7.x
ERROR: column "XXX" is of type XXX but expression is of type character varying Hint: You will need to rewrite or cast the expression.
해당 오류가 발생 할 때, SpringBoot 3.x 버전과 2.x버전의 해결 방법에 차이점이 있었다.
SpringBoot 3.x는 간편하게 Hibernate 6.0에서 지원하는 @JdbcTypeCode(SqlTypes.NAMED_ENUM)을 적용하면 된다고 한다.
하지만 난 2.7.x버전(전자정부 프레임워크 4.2)에서 개발 중이기 때문에 충돌우려가 있어, 시간을 들여 계속 검색한 결과, postgreSQL 접속 url에 파라미터를 추가하면 간단하게 해결되는것을 확인했다.
stringtype=unspecified
'develop > Spring(boot 포함)' 카테고리의 다른 글
Spring boot 에서 JPA설정 (0) | 2025.01.21 |
---|