package hozza.network.models.twitch.entities;

import java.time.LocalDateTime;

import javax.persistence.*;

@Entity(name="watching")
@Table(name="watching", indexes = @Index(columnList = "date_time_watched"))
public class MariaWatching 
{
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", updatable = false, nullable = false)
    private Long id;

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "streamer", nullable = false)
    private MariaStreamer streamer;

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "person", nullable = false)
    private MariaPerson person;

    @Column(name = "date_time_watched")
    protected LocalDateTime dateTimeWatched;

    protected MariaWatching()
    {

    }

    public Long getId()
    {
        return this.id;
    }

    public MariaWatching(LocalDateTime dateTimeWatched, MariaStreamer streamer, MariaPerson person)
    {
        this.dateTimeWatched = dateTimeWatched;
        this.streamer = streamer;
        this.person = person;
    }

    public MariaStreamer getStreamer() {
        return streamer;
    }

    public void setStreamer(MariaStreamer streamer) {
        this.streamer = streamer;
    }

    public MariaPerson getPerson() {
        return person;
    }

    public void setPerson(MariaPerson person) {
        this.person = person;
    }

    public LocalDateTime getDateTimeWatched() {
        return dateTimeWatched;
    }

    public void setDateTimeWatched(LocalDateTime dateTimeWatched) {
        this.dateTimeWatched = dateTimeWatched;
    }

    
}
