package com.kamco.cd.training.postgres.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.IdClass;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "tb_model_dataset_mapp")
@IdClass(ModelDatasetMappEntity.ModelDatasetMappId.class)
public class ModelDatasetMappEntity {

  @Id
  @NotNull
  @Column(name = "model_uid", nullable = false)
  private Long modelUid;

  @Id
  @NotNull
  @Column(name = "dataset_uid", nullable = false)
  private Long datasetUid;

  // TODO 미사용시작
  @Size(max = 20)
  @Column(name = "dataset_type", length = 20)
  private String datasetType;

  // TODO 미사용 끝

  @Getter
  @Setter
  @NoArgsConstructor
  @AllArgsConstructor
  public static class ModelDatasetMappId implements Serializable {
    private Long modelUid;
    private Long datasetUid;
  }
}
