package com.dbnt.kcgfilemanager.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 = "HASH_TAG_LINK")
@IdClass(HashTagLink.HashTagLinkId.class)
public class HashTagLink {

  @Id
  @Column(name = "CONTENT_SEQ", nullable = false)
  private Integer contentSeq;
  @Id
  @Column(name = "TAG_SEQ", nullable = false)
  private Integer tagSeq;

  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class HashTagLinkId implements Serializable {
    private Integer contentSeq;
    private Integer tagSeq;
  }
}
