VisitJpa corregido
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
package jpa;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.sql.time;
|
||||
import java.util.Date;
|
||||
|
||||
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;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
@@ -32,12 +27,6 @@ public class VisitJPA implements Serializable {
|
||||
private String time;
|
||||
private String observations;
|
||||
private String result;
|
||||
@ManyToOne
|
||||
@JoinColumn (name="FamilyDoctorId")
|
||||
private FamilyDoctorJPA familyDoctor;
|
||||
@ManyToOne
|
||||
@JoinColumn (name="PatientId")
|
||||
private PatientJPA patient;
|
||||
|
||||
|
||||
/**
|
||||
@@ -89,35 +78,4 @@ public class VisitJPA implements Serializable {
|
||||
this.observations = observations;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Metodos para get/set de relaciones (pacientes)
|
||||
* @return
|
||||
*/
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "FamilyDoctorId")
|
||||
public Collection<PatientJPA> getPatients() {
|
||||
return patients;
|
||||
}
|
||||
|
||||
public void setPatients(Collection<PatientJPA> patients) {
|
||||
this.patients = patients;
|
||||
}
|
||||
/**
|
||||
* Methods get/set persistent relationships
|
||||
*/
|
||||
public FamilyDoctorJPA getFamilyDoctor() {
|
||||
return familyDoctor;
|
||||
}
|
||||
public void setFamilyDoctor(FamilyDoctorJPA familyDoc) {
|
||||
this.familyDoctor = familyDoc;
|
||||
}
|
||||
public PatientJPA getPatient() {
|
||||
return patient;
|
||||
}
|
||||
public void setPatient(PatientJPA pat) {
|
||||
this.patient=pat;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user