본문 바로가기
백엔드/Spring

[error] spring column insert="false" update="false"

by 작은소행성 2021. 5. 18.

spring boot / jpa 로 작업을 하던 중에

외래키와 이름이 동일한 컬럼이 있는채로 실행했을 때 아래와 간은 오류가 났다.

 

spring column insert="false" update="false"

 

 

 

오류를 해결하기 위해선 필드에 다음 옵션을 추가해주면 된다

 

 @Column(insertable=false, updatable=false)
 private BigInteger api_info_id;

 

 

이 컬럼은 추가/수정이 불가능하다고 선언하는것이다.

 

 

 

 

 

 

반응형