package com.dbnt.kcscbackend.admin.config.entity;

import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "tb_menu_role")
@IdClass(TbMenuRole.TbMenuRoleId.class)
public class TbMenuRole {
  @Id
  @Column(name = "role_id")
  private String roleId;
  @Id
  @Column(name = "menu_id")
  private String menuId;
  @Column(name = "write_yn")
  private String writeYn;

  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class TbMenuRoleId implements Serializable {
    private String roleId;
    private String menuId;
  }
}
