package com.dbnt.kcscbackend.standardCode.entity;

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

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

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "tn_document_favorites")
@IdClass(TnDocumentFavorites.TnDocumentFavoritesId.class)
public class TnDocumentFavorites {
  @Id
  @Column(name = "user_seq")
  private Integer userSeq;
  @Id
  @Column(name = "group_seq")
  private Integer groupSeq;

  @Transient
  private Boolean active;


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