package com.dbnt.kcgfilemanager.model;

import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "BOARD_LOG")
@IdClass(BoardLog.BoardLogId.class)
public class BoardLog {

  @Id
  @Column(name = "CONTENT_SEQ", nullable = false)
  private Integer contentSeq;
  @Id
  @Column(name = "LOG_SEQ", nullable = false)
  private Integer logSeq;

  @Column(name = "LOG_STATUS")
  private String logStatus;
  @Column(name = "DESCRIPTION")
  private String description;
  @Column(name = "CREATE_ID")
  private String createId;
  @Column(name = "CREATE_DATE")
  private LocalDateTime createDate;

  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class BoardLogId implements Serializable {
    private Integer contentSeq;
    private Integer logSeq;
  }
}
