PollAnswer.java 1020 Bytes
package fi.insomnia.bortal.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "poll_answer")
public class PollAnswer extends GenericEventChild implements Serializable {

    private static final long serialVersionUID = 1L;

    @Lob
    @Column(name = "answer_text", nullable = true)
    private String answerText;

    @ManyToOne
    @Column(name = "question_id", nullable = false)
    private PossibleAnswer choice;

    public void setAnswerText(String answerText) {
        this.answerText = answerText;
    }

    public PollAnswer(PollQuestion q)
    {
        super(new EventPk(q.getId().getId()));
    }
    
    public String getAnswerText() {
        return answerText;
    }

    public void setChoise(PossibleAnswer choice) {
        this.choice = choice;
    }

    public PossibleAnswer getChoice() {
        return choice;
    }
}