package com.dbnt.sims.fpiMgt.affairResult.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 = "result_apprv")
@IdClass(ResultApprv.ResultApprvId.class)
public class ResultApprv {
  @Id
  @Column(name = "result_key")
  private Integer resultKey;
  @Id
  @Column(name = "apprv_seq")
  private Integer apprvSeq;
  @Column(name = "state")
  private String state;
  @Column(name = "user_seq")
  private Integer userSeq;
  @Column(name = "user_nm")
  private String userNm;
  @Column(name = "etc")
  private String etc;
  @Column(name = "save_dt")
  private LocalDateTime saveDt;

  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class ResultApprvId implements Serializable {
    private Integer resultKey;
    private Integer apprvSeq;
  }
}
