Poll.java 1.77 KB
package fi.insomnia.bortal.model;

import static javax.persistence.TemporalType.TIMESTAMP;

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

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;

/**
 * Entity implementation class for Entity: Poll
 * 
 */
@Entity
@Table(name = "poll")
public class Poll extends GenericEventChild implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = -5655775315722028984L;

    @Temporal(TIMESTAMP)
    private Calendar begin = Calendar.getInstance();
    @Temporal(TIMESTAMP)
    private Calendar end = Calendar.getInstance();
    private String name;
    @Lob
    private String description;

    @OneToMany(mappedBy = "poll", fetch = FetchType.EAGER)
    private List<PollQuestion> questions;

    public Poll() {
        super();
    }

    public Poll(LanEvent e) {
        super(e);
    }

    public Calendar getBegin() {
        return begin;
    }

    public void setBegin(Calendar begin) {
        this.begin = begin;
    }

    public Calendar getEnd() {
        return end;
    }

    public void setEnd(Calendar end) {
        this.end = end;
    }

    public String getName() {
        return name;
    }

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

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setQuestions(List<PollQuestion> questions) {
        this.questions = questions;
    }

    public List<PollQuestion> getQuestions() {
        return questions;
    }

}