package metier;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

@Entity
@Getter
@Setter
@NoArgsConstructor
public class Question implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;
    private String question;

    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name ="bonne_reponse", referencedColumnName = "id")
    private Reponse reponse;

    @ManyToOne
    @JoinColumn(name="id_quizz")
    private Quizz quizz;
}
