Cambios para la edición del perfil de usuario y su actualización (Vista,
managed bean, metodos en EJB para recuperar datos de Paciente, Medico de familia y medico especialista).
This commit is contained in:
@@ -26,13 +26,18 @@ public class FamilyDoctorJPA implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private int id;
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
private String nif;
|
||||
private String name;
|
||||
private String surname;
|
||||
private String password;
|
||||
private String email;
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "FamilyDoctorId")
|
||||
private Collection<PatientJPA> patients;
|
||||
@ManyToOne
|
||||
@JoinColumn (name="PrimaryHealthCareCenterId")
|
||||
private PrimaryHealthCareCenterJPA primaryHealthCareCenter;
|
||||
|
||||
/**
|
||||
@@ -51,13 +56,11 @@ public class FamilyDoctorJPA implements Serializable {
|
||||
this.primaryHealthCareCenter = phc;
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
public int getId() {
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int value) {
|
||||
public void setId(Integer value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
@@ -105,8 +108,6 @@ public class FamilyDoctorJPA implements Serializable {
|
||||
* Metodos para get/set de relaciones (pacientes)
|
||||
* @return
|
||||
*/
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "FamilyDoctorId")
|
||||
public Collection<PatientJPA> getPatients() {
|
||||
return patients;
|
||||
}
|
||||
@@ -115,8 +116,6 @@ public class FamilyDoctorJPA implements Serializable {
|
||||
this.patients = patients;
|
||||
}
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn (name="PrimaryHealthCareCenterId")
|
||||
public PrimaryHealthCareCenterJPA getPrimaryHealthCareCenter() {
|
||||
return primaryHealthCareCenter;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class PatientJPA implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
private int id;
|
||||
private Integer id;
|
||||
private String nif;
|
||||
private String name;
|
||||
private String surname;
|
||||
@@ -40,19 +40,20 @@ public class PatientJPA implements Serializable {
|
||||
super();
|
||||
}
|
||||
|
||||
public PatientJPA(String nif, String name, String surname, String password, String email) {
|
||||
public PatientJPA(String nif, String name, String surname, String password, String email, FamilyDoctorJPA familyDoc) {
|
||||
this.nif = nif;
|
||||
this.name = name;
|
||||
this.surname = surname;
|
||||
this.password = password;
|
||||
this.email = email;
|
||||
this.familyDoctor = familyDoc;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int value) {
|
||||
public void setId(Integer value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
@@ -96,9 +97,6 @@ public class PatientJPA implements Serializable {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Methods get/set persistent relationships
|
||||
*/
|
||||
public FamilyDoctorJPA getFamilyDoctor() {
|
||||
return familyDoctor;
|
||||
}
|
||||
|
||||
@@ -22,12 +22,15 @@ public class SpecialistDoctorJPA implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private int id;
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
private String nif;
|
||||
private String name;
|
||||
private String surname;
|
||||
private String password;
|
||||
private String email;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "MedicalSpecialtyId")
|
||||
private MedicalSpecialtyJPA medicalSpecialty;
|
||||
|
||||
/**
|
||||
@@ -46,13 +49,11 @@ public class SpecialistDoctorJPA implements Serializable {
|
||||
this.medicalSpecialty = ms;
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
public int getId() {
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int value) {
|
||||
public void setId(Integer value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
@@ -96,8 +97,6 @@ public class SpecialistDoctorJPA implements Serializable {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "MedicalSpecialtyId")
|
||||
public MedicalSpecialtyJPA getMedicalSpecialty() {
|
||||
return medicalSpecialty;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user