package ovh.herisson.Clyde.Tables;

import jakarta.persistence.*;

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

    //Un étudiant peut avoir plusieurs cursus
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "Users")
    private User user;

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "Cursus")
    private Cursus cursus;

    public UserCursus(User user, Cursus cursus){
        this.user = user;
        this.cursus = cursus;
    }

    public UserCursus() {}

    public int getId() {
        return id;
    }

    public User getUser() {
        return user;
    }

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

    public Cursus getCursus() {
        return cursus;
    }

    public void setCursus(Cursus cursus) {
        this.cursus = cursus;
    }
}
