Avances en la pantalla de registro de usuarios nuevos (pacientes).

* Actualización de script para crear tablas (Todo a minusculas, no case
sensitive)
* Script de datos de pruebas de especialides médicas.
* Nuevo bean para registro de usuarios (Quidato de filtro de seguridad
de login, acceso sin login).
* Actualización de entidades JPA con campos Identity.
* Enumerado para gestionar tipos de usuarios (Paciente, Medico Familia,
Especialista y Administrador)
* Clase común para realizar validaciones (función para validar nif).
This commit is contained in:
mgarcianun
2019-11-27 00:11:21 +01:00
parent 3686ead2ba
commit 9859f83326
26 changed files with 788 additions and 202 deletions

View File

@@ -6,6 +6,8 @@ import java.util.Collection;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@@ -24,7 +26,7 @@ public class FamilyDoctorJPA implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private String id;
private Integer id;
private String nif;
private String name;
private String surname;
@@ -40,7 +42,7 @@ public class FamilyDoctorJPA implements Serializable {
super();
}
public FamilyDoctorJPA(String id, String nif, String name, String surname, String password, String email) {
public FamilyDoctorJPA(Integer id, String nif, String name, String surname, String password, String email) {
this.id = id;
this.nif = nif;
this.name = name;
@@ -50,11 +52,12 @@ public class FamilyDoctorJPA implements Serializable {
}
@Id
public String getId() {
@GeneratedValue(strategy=GenerationType.IDENTITY)
public Integer getId() {
return id;
}
public void setId(String value) {
public void setId(Integer value) {
this.id = value;
}

View File

@@ -3,6 +3,8 @@ package jpa;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@@ -20,12 +22,15 @@ public class PatientJPA implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private String 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="FamilyDoctorId")
private FamilyDoctorJPA familyDoctor;
/**
@@ -35,7 +40,7 @@ public class PatientJPA implements Serializable {
super();
}
public PatientJPA(String id, String nif, String name, String surname, String password, String email) {
public PatientJPA(Integer id, String nif, String name, String surname, String password, String email) {
this.id = id;
this.nif = nif;
this.name = name;
@@ -44,12 +49,11 @@ public class PatientJPA implements Serializable {
this.email = email;
}
@Id
public String getId() {
public Integer getId() {
return id;
}
public void setId(String value) {
public void setId(Integer value) {
this.id = value;
}
@@ -96,8 +100,6 @@ public class PatientJPA implements Serializable {
/**
* Methods get/set persistent relationships
*/
@ManyToOne
@JoinColumn (name="FamilyDoctorId")
public FamilyDoctorJPA getFamilyDoctor() {
return familyDoctor;
}

View File

@@ -33,7 +33,6 @@ public class PrimaryHealthCareCenterJPA implements Serializable {
this.description = description;
}
@Id
public String getName() {
return name;
}

View File

@@ -3,6 +3,8 @@ package jpa;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@@ -20,7 +22,7 @@ public class SpecialistDoctorJPA implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private String id;
private Integer id;
private String nif;
private String name;
private String surname;
@@ -35,7 +37,7 @@ public class SpecialistDoctorJPA implements Serializable {
super();
}
public SpecialistDoctorJPA(String id, String nif, String name, String surname, String password, String email) {
public SpecialistDoctorJPA(Integer id, String nif, String name, String surname, String password, String email) {
this.id = id;
this.nif = nif;
this.name = name;
@@ -45,11 +47,12 @@ public class SpecialistDoctorJPA implements Serializable {
}
@Id
public String getId() {
@GeneratedValue(strategy=GenerationType.IDENTITY)
public Integer getId() {
return id;
}
public void setId(String value) {
public void setId(Integer value) {
this.id = value;
}