package metier;

import jakarta.persistence.*;

import java.io.Serializable;
import java.util.List;

@Entity
public class Utilisateur implements Serializable {

    private int id;
    private String name;
    private Session session;
    private String email;
    private String password;

    @OneToMany(mappedBy = "utilisateur")
    private List<Quizz> activities;

    public Utilisateur() {}

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(unique=true)
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @ManyToMany
    public Session getSession() {
        return session;
    }
}