package com.example.video_downloader.entity;

import jakarta.persistence.*;
import lombok.Data;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

@Data
@ToString
@Entity
@Table(name = "videos")
public class Video {
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    private Long id;

    private String url;
    private String ytdl;
    private String ytMetaData;

    @Enumerated(EnumType.STRING)
    private StatusEnum status;

    private String fullPath;

    @ManyToMany
    @JoinTable(
            name = "video_playlist",
            joinColumns = @JoinColumn(name = "video_id"),
            inverseJoinColumns = @JoinColumn(name = "playlist_id")
    )
    private List<Playlist> playlist = new ArrayList<>();

    @OneToOne
    @JoinColumn(name = "creator_id")
    private Creator creator;



}
