728x90
반응형
@Entity
@NoArgsConstructor
public class Channel{
@Id
@GeneratedValue
private String id;
private String name;
private String reference;
private AccessType accessType;
private ChannelType channelType;
@CreatedDate
private LocalDateTime createdTime;
@LastModifiedDate
private LocalDateTime updatedTime;
@Builder
public Channel(String name, String reference, AccessType accessType, ChannelType channelType) {
this.name = name;
this.reference = reference;
this.accessType = accessType;
this.channelType = channelType;
}
}
@Entity
@NoArgsConstructor
public class Channel{
@Id
@GeneratedValue
private Long id;
private String name;
private String reference;
private AccessType accessType;
private ChannelType channelType;
@CreatedDate
private LocalDateTime createdTime;
@LastModifiedDate
private LocalDateTime updatedTime;
@Builder
public Channel(String name, String reference, AccessType accessType, ChannelType channelType) {
this.name = name;
this.reference = reference;
this.accessType = accessType;
this.channelType = channelType;
}
}
SpringBoot의 Annotation @GeneratedValue를 사용할 때의 id의 데이터형은 String이 아닌 정수형 Long, Integer로 처리해야한다.
728x90
반응형
'ERROR' 카테고리의 다른 글
[ERROR/에러] Null value was assigned to a property ~ of primitive type (0) | 2024.03.28 |
---|---|
[ERROR/에러] MySQL Data too long for column (0) | 2024.03.06 |
[ERROR/에러] 카프카와 주키퍼 실행 에러 "입력 줄이 너무 깁니다. 명령 구문이 올바르지 않습니다." (0) | 2024.01.19 |
[ERROR/에러] APACHE KAFKA 아파치 카프카 실행 에러 (0) | 2024.01.19 |