package jp.agentec.sinaburocast.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="t_reply")
public class Reply extends AbstractEntity {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "reply_id")
	public Long replyId;

	@Column(name = "member_id")
	public Integer memberId;

	@Column(name = "question_id")
	public Integer questionId;

	@Column(name = "answer_id")
	public Integer answerId;

	public String answer;

	@Column(name = "question_no")
	public Integer questionNo;

	@Column(name = "enquete_id")
	public Integer enqueteId;
	
	@Column(name = "answer_times")
	public Integer answerTimes;

	@Column(name = "zip_code")
	public String zipCode;

	@Column(name = "gender_cd")
	public Integer genderCd;

	@Column(name = "age")
	public Integer age;

    @ManyToOne
    @JoinColumn(name = "member_id", referencedColumnName = "member_id")
	public Member member;

    /** MAnswer関連プロパティ */
    @ManyToOne
    @JoinColumn(name = "answer_id", referencedColumnName = "answer_id")
    public Answer answerReply;

    /** MQuestion関連プロパティ */
    @ManyToOne
    @JoinColumn(name = "question_id", referencedColumnName = "question_id")
    public Question question;

    @ManyToOne
    @JoinColumn(name = "enquete_id", referencedColumnName = "enquete_id")
    public Enquete enquete;
}