package ovh.herisson.Clyde.Tables;

import jakarta.persistence.*;

@Entity
public class TeacherGivenCourse {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "Users")
    private User user;


    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "Course")
    private Course course;

    //This flag helps make the difference between an assistant or a Teacher (who owns the course)
    private boolean owned;

    public TeacherGivenCourse(User user, Course course, boolean owned){
        this.user = user;
        this.course = course;
        this.owned = owned;
    }

    public TeacherGivenCourse() {}

    public int getId() {
        return id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Course getCourse() {
        return course;
    }

    public void setCourse(Course course) {
        this.course = course;
    }

    public boolean isOwned() {
        return owned;
    }

    public void setOwned(boolean owned) {
        this.owned = owned;
    }
}
