* Login de diferentes usuarios completado. * Cambiado esquema de BBDD, campos texto a character varying. * Cambiada relación entre paciente y medico de cabecera. * Movida clase UserType a paquete common ya que se utiliza en el EJB. * Datos de prueba para realizar logins, el password es admin para todos (hashMD5).
109 lines
2.1 KiB
Java
109 lines
2.1 KiB
Java
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;
|
|
import javax.persistence.Table;
|
|
|
|
/**
|
|
*
|
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
|
*
|
|
*/
|
|
@Entity
|
|
@Table(name = "MyHealth.SpecialistDoctor")
|
|
public class SpecialistDoctorJPA implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
@Id
|
|
private int id;
|
|
private String nif;
|
|
private String name;
|
|
private String surname;
|
|
private String password;
|
|
private String email;
|
|
private MedicalSpecialtyJPA medicalSpecialty;
|
|
|
|
/**
|
|
* Class constructor methods
|
|
*/
|
|
public SpecialistDoctorJPA() {
|
|
super();
|
|
}
|
|
|
|
public SpecialistDoctorJPA(Integer id, String nif, String name, String surname, String password, String email) {
|
|
this.id = id;
|
|
this.nif = nif;
|
|
this.name = name;
|
|
this.surname = surname;
|
|
this.password = password;
|
|
this.email = email;
|
|
}
|
|
|
|
@Id
|
|
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(int value) {
|
|
this.id = value;
|
|
}
|
|
|
|
public String getNif() {
|
|
return nif;
|
|
}
|
|
|
|
public void setNif(String value) {
|
|
this.nif = value;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String value) {
|
|
this.name = value;
|
|
}
|
|
|
|
public String getSurname() {
|
|
return surname;
|
|
}
|
|
|
|
public void setSurname(String surname) {
|
|
this.surname = surname;
|
|
}
|
|
|
|
public String getPassword() {
|
|
return password;
|
|
}
|
|
|
|
public void setPassword(String password) {
|
|
this.password = password;
|
|
}
|
|
|
|
public String getEmail() {
|
|
return email;
|
|
}
|
|
|
|
public void setEmail(String email) {
|
|
this.email = email;
|
|
}
|
|
|
|
@ManyToOne
|
|
@JoinColumn(name = "MedicalSpecialtyId")
|
|
public MedicalSpecialtyJPA getMedicalSpecialty() {
|
|
return medicalSpecialty;
|
|
}
|
|
|
|
public void setMedicalSpecialty(MedicalSpecialtyJPA specialty) {
|
|
this.medicalSpecialty = specialty;
|
|
}
|
|
}
|