Merge branch 'master' into rorden
This commit is contained in:
@@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
@@ -26,8 +27,11 @@ public class FamilyDoctorJPA implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@Column(updatable = false)
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
@Column(nullable = false, unique = true)
|
||||
private String professionalNumber;
|
||||
private String nif;
|
||||
private String name;
|
||||
private String surname;
|
||||
@@ -47,7 +51,8 @@ public class FamilyDoctorJPA implements Serializable {
|
||||
super();
|
||||
}
|
||||
|
||||
public FamilyDoctorJPA(String nif, String name, String surname, String password, String email, PrimaryHealthCareCenterJPA phc) {
|
||||
public FamilyDoctorJPA(String pin, String nif, String name, String surname, String password, String email, PrimaryHealthCareCenterJPA phc) {
|
||||
this.setProfessionalNumber(pin);
|
||||
this.nif = nif;
|
||||
this.name = name;
|
||||
this.surname = surname;
|
||||
@@ -122,4 +127,12 @@ public class FamilyDoctorJPA implements Serializable {
|
||||
public void setPrimaryHealthCareCenter(PrimaryHealthCareCenterJPA center) {
|
||||
this.primaryHealthCareCenter = center;
|
||||
}
|
||||
|
||||
public String getProfessionalNumber() {
|
||||
return professionalNumber;
|
||||
}
|
||||
|
||||
public void setProfessionalNumber(String professionalNumber) {
|
||||
this.professionalNumber = professionalNumber;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,10 @@ package jpa;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@@ -18,6 +21,9 @@ public class MedicalSpecialtyJPA implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@Column(updatable = false)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
private String name;
|
||||
private String description;
|
||||
|
||||
@@ -33,7 +39,14 @@ public class MedicalSpecialtyJPA implements Serializable {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Id
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package jpa;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
@@ -22,15 +23,18 @@ public class PatientJPA implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
@Column(updatable = false)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
@Column(nullable = false, unique = true)
|
||||
private String personalIdentificationCode;
|
||||
private String nif;
|
||||
private String name;
|
||||
private String surname;
|
||||
private String password;
|
||||
private String email;
|
||||
@ManyToOne
|
||||
@JoinColumn (name="FamilyDoctorId")
|
||||
@JoinColumn(name = "FamilyDoctorId")
|
||||
private FamilyDoctorJPA familyDoctor;
|
||||
|
||||
/**
|
||||
@@ -40,7 +44,8 @@ public class PatientJPA implements Serializable {
|
||||
super();
|
||||
}
|
||||
|
||||
public PatientJPA(String nif, String name, String surname, String password, String email, FamilyDoctorJPA familyDoc) {
|
||||
public PatientJPA(String pic, String nif, String name, String surname, String password, String email, FamilyDoctorJPA familyDoc) {
|
||||
this.personalIdentificationCode = pic;
|
||||
this.nif = nif;
|
||||
this.name = name;
|
||||
this.surname = surname;
|
||||
@@ -96,11 +101,20 @@ public class PatientJPA implements Serializable {
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
|
||||
public FamilyDoctorJPA getFamilyDoctor() {
|
||||
return familyDoctor;
|
||||
}
|
||||
public void setFamilyDoctor(FamilyDoctorJPA familyDoc) {
|
||||
|
||||
public void setFamilyDoctor(FamilyDoctorJPA familyDoc) {
|
||||
this.familyDoctor = familyDoc;
|
||||
}
|
||||
|
||||
public String getPersonalIdentificationCode() {
|
||||
return personalIdentificationCode;
|
||||
}
|
||||
|
||||
public void setPersonalIdentificationCode(String personalIdentificationCode) {
|
||||
this.personalIdentificationCode = personalIdentificationCode;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,10 @@ package jpa;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@@ -18,6 +21,9 @@ public class PrimaryHealthCareCenterJPA implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@Column(updatable = false)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
private String name;
|
||||
private String location;
|
||||
|
||||
@@ -33,6 +39,14 @@ public class PrimaryHealthCareCenterJPA implements Serializable {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package jpa;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
@@ -22,15 +23,18 @@ public class SpecialistDoctorJPA implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
@Column(updatable = false)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
@Column(nullable = false, unique = true)
|
||||
private String professionalNumber;
|
||||
private String nif;
|
||||
private String name;
|
||||
private String surname;
|
||||
private String password;
|
||||
private String email;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "MedicalSpecialtyId")
|
||||
@JoinColumn(name = "MedicalSpecialtyId")
|
||||
private MedicalSpecialtyJPA medicalSpecialty;
|
||||
|
||||
/**
|
||||
@@ -40,7 +44,8 @@ public class SpecialistDoctorJPA implements Serializable {
|
||||
super();
|
||||
}
|
||||
|
||||
public SpecialistDoctorJPA(String nif, String name, String surname, String password, String email, MedicalSpecialtyJPA ms) {
|
||||
public SpecialistDoctorJPA(String pic, String nif, String name, String surname, String password, String email, MedicalSpecialtyJPA ms) {
|
||||
this.setProfessionalNumber(pic);
|
||||
this.nif = nif;
|
||||
this.name = name;
|
||||
this.surname = surname;
|
||||
@@ -104,4 +109,12 @@ public class SpecialistDoctorJPA implements Serializable {
|
||||
public void setMedicalSpecialty(MedicalSpecialtyJPA specialty) {
|
||||
this.medicalSpecialty = specialty;
|
||||
}
|
||||
|
||||
public String getProfessionalNumber() {
|
||||
return professionalNumber;
|
||||
}
|
||||
|
||||
public void setProfessionalNumber(String professionalNumber) {
|
||||
this.professionalNumber = professionalNumber;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
import java.sql.Time;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
@@ -12,7 +13,6 @@ import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||
@@ -25,17 +25,19 @@ public class VisitJPA implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@Column(updatable = false)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
private Date date;
|
||||
private Time time;
|
||||
private String observations;
|
||||
private String result;
|
||||
@ManyToOne
|
||||
@JoinColumn (name="FamilyDoctorId")
|
||||
private FamilyDoctorJPA familyDoctor;
|
||||
@ManyToOne
|
||||
@JoinColumn (name="PatientId")
|
||||
private PatientJPA patient;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "FamilyDoctorId")
|
||||
private FamilyDoctorJPA familyDoctor;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "PatientId")
|
||||
private PatientJPA patient;
|
||||
|
||||
/**
|
||||
* Class constructor methods
|
||||
@@ -46,14 +48,14 @@ public class VisitJPA implements Serializable {
|
||||
|
||||
public VisitJPA(Integer id, Date date, Time time, String observations, String result) {
|
||||
this.id = id;
|
||||
this.date=date;
|
||||
this.date = date;
|
||||
this.time = time;
|
||||
this.observations = observations;
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -85,21 +87,23 @@ public class VisitJPA implements Serializable {
|
||||
public void setObservations(String observation) {
|
||||
this.observations = observations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Methods get/set persistent relationships
|
||||
*/
|
||||
public FamilyDoctorJPA getFamilyDoctor() {
|
||||
return familyDoctor;
|
||||
}
|
||||
public void setFamilyDoctor(FamilyDoctorJPA familyDoc) {
|
||||
|
||||
public void setFamilyDoctor(FamilyDoctorJPA familyDoc) {
|
||||
this.familyDoctor = familyDoc;
|
||||
}
|
||||
|
||||
|
||||
public PatientJPA getPatient() {
|
||||
return patient;
|
||||
}
|
||||
|
||||
public void setPatient (PatientJPA pat) {
|
||||
this.patient=pat;
|
||||
|
||||
public void setPatient(PatientJPA pat) {
|
||||
this.patient = pat;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user