트러블슈팅 - JPA(spring) - incompatible(컬럼 속성 상이)

wonder1ng·2025년 5월 2일
  • 오류문: Caused by: java.sql.SQLException: Referencing column 'user_role_id' and referenced column 'user_role_id' in foreign key constraint 'FK_user_user_role_id' are incompatible.

  • 문제: java에서는 자료형이 같지만 계속 컬럼의 자료형이 다르다고 오류 발생

  • 원인: sql의 자료형과 제약조건이 java와 다름.

  • 해결: @Column(columnDefinition = "TINYINT UNSIGNED")

    • columnDefinition으로 자료형 명확하게 정의
profile
데이터, 풀스택

0개의 댓글