package com.dbnt.faisp.main.userInfo.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 = "dashboard_config")
@IdClass(DashboardConfig.DashboardConfigId.class)
public class DashboardConfig {
  @Id
  @Column(name = "menu_key")
  private Integer menuKey;
  @Id
  @Column(name = "user_seq")
  private Integer userSeq;
  @Column(name = "order_num")
  private Integer orderNum;

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

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