Corrección de errores en clase VisitJPA.

This commit is contained in:
mgarcianun
2019-12-02 15:46:13 +01:00
parent 8fe3d86e36
commit 293d1c9217

View File

@@ -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;
/**
@@ -29,7 +24,7 @@ public class VisitJPA implements Serializable {
@Id
private Integer id;
private Date date;
private String time;
private Time time;
private String observations;
private String result;
@@ -58,19 +53,19 @@ public class VisitJPA implements Serializable {
this.id = value;
}
public String getDate() {
public Date getDate() {
return date;
}
public void setDate(String value) {
public void setDate(Date value) {
this.date = value;
}
public String getTime() {
public Time getTime() {
return time;
}
public void setTime(String value) {
public void setTime(Time value) {
this.time = value;
}
@@ -82,28 +77,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;
}
@ManyToOne
@JoinColumn (name="PrimaryHealthCareCenterId")
public PrimaryHealthCareCenterJPA getPrimaryHealthCareCenter() {
return primaryHealthCareCenter;
}
public void setPrimaryHealthCareCenter(PrimaryHealthCareCenterJPA center) {
this.primaryHealthCareCenter = center;
}
}