package studycave.studycaverestservice.model.test.question;

import com.fasterxml.jackson.annotation.JsonBackReference;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Getter
@Setter
@AllArgsConstructor
public abstract class Answer {
    @Id
    @Column(name="id_ans")
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(hidden = true)
    @ManyToOne
    @JoinColumn(name="id_question",referencedColumnName="id")
    @JsonBackReference
    private Question question;

    public Answer() {
        super();
    }
}
