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

@@ -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;
}