From 293d1c9217378239575c43aeca12d0a89c9a473a Mon Sep 17 00:00:00 2001 From: mgarcianun Date: Mon, 2 Dec 2019 15:46:13 +0100 Subject: [PATCH] =?UTF-8?q?Correcci=C3=B3n=20de=20errores=20en=20clase=20V?= =?UTF-8?q?isitJPA.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.sources/MyHealth/src/jpa/VisitJPA.java | 41 ++++-------------------- 1 file changed, 6 insertions(+), 35 deletions(-) diff --git a/1.sources/MyHealth/src/jpa/VisitJPA.java b/1.sources/MyHealth/src/jpa/VisitJPA.java index bb15373..56da4ce 100644 --- a/1.sources/MyHealth/src/jpa/VisitJPA.java +++ b/1.sources/MyHealth/src/jpa/VisitJPA.java @@ -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 getPatients() { - return patients; - } - - public void setPatients(Collection patients) { - this.patients = patients; - } - - @ManyToOne - @JoinColumn (name="PrimaryHealthCareCenterId") - public PrimaryHealthCareCenterJPA getPrimaryHealthCareCenter() { - return primaryHealthCareCenter; - } - public void setPrimaryHealthCareCenter(PrimaryHealthCareCenterJPA center) { - this.primaryHealthCareCenter = center; - } }