package jpa;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import TO.QuestionTO;
import common.QuestionStatus;

/**
 * 
 * @author Marcos García Núñez (mgarcianun@uoc.edu)
 * @author Roberto Orden Erena <rorden@uoc.edu>
 *
 */
@Entity
@Table(name = "MyHealth.Question")
public class QuestionJPA implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int id;
	private String title;
	private String message;
	@Enumerated(EnumType.STRING)
	private QuestionStatus status;
	private String response;

	@ManyToOne
	@JoinColumn(name = "patientid")
	private PatientJPA patient;

	@ManyToOne
	@JoinColumn(name = "familydoctorid")
	private FamilyDoctorJPA familyDoctor;

	public QuestionJPA() {
	}

	public QuestionJPA(int id, String title, String message, QuestionStatus status, PatientJPA patient, FamilyDoctorJPA familydoctor, String response) {
		this.id = id;
		this.title = title;
		this.message = message;
		this.status = status;
		this.patient = patient;
		this.familyDoctor = familydoctor;
		this.response = response;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public PatientJPA getPatient() {
		return patient;
	}

	public void setPatient(PatientJPA patient) {
		this.patient = patient;
	}

	public QuestionStatus getStatus() {
		return status;
	}

	public void setStatus(QuestionStatus status) {
		this.status = status;
	}

	public FamilyDoctorJPA getFamilyDoctor() {
		return familyDoctor;
	}

	public void setFamilyDoctor(FamilyDoctorJPA familyDoc) {
		this.familyDoctor = familyDoc;
	}

	public String getResponse() {
		return response;
	}

	public void setResponse(String response) {
		this.response = response;
	}

}
