
해당 테이블을 기준으로 calendar 엔티티를 작성하였다.
package reproject.calendars.entity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
@Entity
@Getter
@NoArgsConstructor
public class Calendar {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
private String description;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
public Calendar(String name, String description) {
this.name = name;
this.description = description;
this.createdAt = LocalDateTime.now();
}
public void update(String name, String description) {
this.name = name;
this.description = description;
this.updatedAt = LocalDateTime.now();
}
}
@Entity , @Id, @GeneratedValue(strategy = GenerationType.IDENTITY)
@NoArgsConstructor