에러 발생
SpringBoot JPA에서 Entity를 save() 할 시점,
IdentifierGenerationException: must be manually assigned before calling 'save()' 오류 발생.
원인
Entity를 save() 하기 전 Entity의 id에 해당하는 값에 데이터를 넣지 않아 발생.
저장하려는 Entity에 @GenratedValue 어노테이션이 있는지 확인.
혹은 직접 entity의 id 데이터를 입력.
@Entity
@Getter
@NoArgsConstructor
public class Log {
@Id
@GeneratedValue //해당부분 확인
private Long id;
private String message;
결과
정상적으로 해당 Entity가 DB에 저장됨.
※ 결론
저장되는 entity의 id값을 확인해 보자.