QuestionTO y QuestionJPA updated

This commit is contained in:
Roberto Orden Erena
2019-12-15 19:24:41 +01:00
parent e5900a8d0f
commit 6eb1bda423
4 changed files with 65 additions and 23 deletions

View File

@@ -1,7 +1,6 @@
package jpa;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@@ -11,8 +10,9 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import TO.FamilyDoctorTO;
import TO.PatientTO;
import TO.SpecialistDoctorTO;
import common.QuestionStatus;
/**
*
@@ -26,25 +26,32 @@ public class QuestionJPA implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String title;
private String message;
private int status;
private QuestionStatus status;
private String response;
@ManyToOne
@JoinColumn (name="PatientId")
@JoinColumn(name = "PatientId")
private PatientTO patient;
@ManyToOne
@JoinColumn(name = "FamilyDoctorId")
private FamilyDoctorTO doctor;
public QuestionJPA() {
}
public QuestionJPA(int id, String title, String message, int status, PatientTO patient) {
public QuestionJPA(int id, String title, String message, QuestionStatus status, PatientTO patient,
FamilyDoctorTO doctor, String response) {
this.id = id;
this.title = title;
this.message = message;
this.status = status;
this.patient = patient;
this.doctor = doctor;
this.response = response;
}
public int getId() {
@@ -71,14 +78,6 @@ public class QuestionJPA implements Serializable {
this.message = message;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public PatientTO getPatient() {
return patient;
}
@@ -86,7 +85,29 @@ public class QuestionJPA implements Serializable {
public void setPatient(PatientTO patient) {
this.patient = patient;
}
public QuestionStatus getStatus() {
return status;
}
public void setStatus(QuestionStatus status) {
this.status = status;
}
public FamilyDoctorTO getDoctor() {
return doctor;
}
public void setDoctor(FamilyDoctorTO doctor) {
this.doctor = doctor;
}
public String getResponse() {
return response;
}
public void setResponse(String response) {
this.response = response;
}
}