package com.dbnt.faisp.main.authMgt.model;

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

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

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "access_config")
@IdClass(AccessConfig.AccessConfigId.class)
public class AccessConfig{
  @Id
  @Column(name = "menu_key")
  private Integer menuKey;
  @Id
  @Column(name = "user_seq")
  private Integer userSeq;
  @Column(name = "access_auth")
  private String accessAuth;

  @Transient
  private String cat1Cd;
  @Transient
  private String cat2Cd;
  @Transient
  private String cat3Cd;

  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class AccessConfigId implements Serializable {
    private Integer menuKey;
    private Integer userSeq;
  }
}
