JPA

Entity의 null값으로 인해 default 설정 반영이 안될 때

초록색거북이 2022. 12. 14. 12:52
728x90
반응형
SMALL

기본적으로 hibernate는 insert 와 update 시 모든 컬럼 을 사용함.

 

 

 

@DynamicInsert

-> Insert 구문 생성 시점에 null이 아닌 칼럼들만 포함시킴.

 

@DynamicUpdate

-> Update 구문 생성 시점에 null이 아닌 칼럼만 포함시킴. 

 

@DynamicInsert
@DynamicUpdate
@Entity
public class Member {
  //...
}

 

 

 

 

 

728x90
반응형
LIST