ERROR 해결

[Java/SpringBoot] ERROR: column $ is of type timestamp without time zone but expression ~ 오류 해결

엘라 ELLA 2022. 11. 7. 12:39
728x90
반응형

Error)

ERROR: column "created_date" is of type timestamp without time zone but expression is of

type character varying

Cause)

DB에서 데이터를 생성 할 때, created_date와 modified_date 두가지는 Data type을 timestamp로 만들었다. 하지만, Dto와 Entity에 속성을 두가지 모두 String 으로 지정해주어서 나는 오류.

 

즉, 특정 컬럼의 Data type을 Dto와 Entity에서 DB의 컬럼이 갖는 Data type과 일치하지 않아서 나는 오류

 

Sol)

Entity와 Dto에 String 타입을 두가지 모두 timestamp로 지정.

특정 컬럼의 Data type을 Dto와 Entity에서 DB의 컬럼이 갖는 Data type과 일치하게 수정해주면 오류가 사라진다.

 


 

 

게시글이 도움이 되었다면

[로그인]이 필요 없는 ❤ 눌러주세요:)

반응형