This commit is contained in:
Marcos Garcia Nuñez
2019-12-08 22:26:54 +01:00
3 changed files with 169 additions and 82 deletions

17
.project Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>myhealth3</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.jboss.ide.eclipse.archives.core.archivesBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.jboss.ide.eclipse.archives.core.archivesNature</nature>
</natures>
</projectDescription>

View File

@@ -17,13 +17,57 @@ import javax.xml.bind.annotation.XmlRootElement;
*/ */
@XmlRootElement(name = "Visit") @XmlRootElement(name = "Visit")
public class VisitTO implements Serializable { public class VisitTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Integer id;
private Date date;
private Time time;
private String observations;
private String result;
private FamilyDoctorTO familyDoctor;
private PatientTO patient;
public VisitTO() { public VisitTO() {
super(); super();
} }
public VisitTO(Integer id, Date date, Time time, String observation, String result) {
this.setId(id);
this date=date;
this time
1}
public Integer getId() {
return this.id;
}
public void setId(integer id) {
this.id=id;
}
public Date getDate() {
return this.Date;
}
public void setDate(Date date) {
this.date=date;
}
public Time getTime() {
return this.time;
}
public void setTime(Time time) {
this.time=time;
}
public String getObservations() {
return this.observations;
}
public void setObservations(String observations) {
this.observations=observations;
}
} }

View File

@@ -1,80 +1,106 @@
package jpa; <<<<<<< HEAD
package jpa;
import java.io.Serializable;
import java.sql.Time; import java.io.Serializable;
import java.util.Date; import java.sql.time;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.Entity;
import javax.persistence.GenerationType; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.GenerationType;
import javax.persistence.Table; import javax.persistence.Id;
import javax.persistence.Table;
/** import javax.persistence.JoinColumn;
* import javax.persistence.ManyToOne;
* @author Marcos García Núñez (mgarcianun@uoc.edu) @ManyToOne
* @JoinColumn (name="FamilyDoctorId")
*/ private FamilyDoctorJPA familyDoctor;
@Entity @ManyToOne
@Table(name = "MyHealth.Visit") @JoinColumn (name="PatientId")
public class VisitJPA implements Serializable { private PatientJPA patient;
private static final long serialVersionUID = 1L; /**
*
@Id * @author Marcos García Núñez (mgarcianun@uoc.edu)
private Integer id; *
private Date date; */
private Time time; @Entity
private String observations; @Table(name = "MyHealth.Visit")
private String result; public class VisitJPA implements Serializable {
/** private static final long serialVersionUID = 1L;
* Class constructor methods
*/ @Id
public VisitJPA() { private Integer id;
super(); private Date date;
} private Time time;
private String observations;
public VisitJPA(Integer id, Date date, Time time, String observations, String result) { private String result;
this.id = id;
this.date=date;
this.time = time; /**
this.observations = observations; * Class constructor methods
this.result = result; */
} public VistitJPA() {
super();
@Id }
@GeneratedValue(strategy=GenerationType.IDENTITY)
public Integer getId() { public VisitJPA(Integer id, Date date, Time time, String observations, String result) {
return id; this.id = id;
} this.date=date;
this.time = time;
public void setId(Integer value) { this.observations = observations;
this.id = value; this.result = result;
} }
public Date getDate() { @Id
return date; @GeneratedValue(strategy=GenerationType.IDENTITY)
} public Integer getId() {
return id;
public void setDate(Date value) { }
this.date = value;
} public void setId(Integer value) {
this.id = value;
public Time getTime() { }
return time;
} public String getDate() {
return date;
public void setTime(Time value) { }
this.time = value;
} public void setDate(String value) {
this.date = value;
public String getObservations() { }
return observations;
} public String getTime() {
return time;
public void setObservations(String observation) { }
this.observations = observations;
} public void setTime(String value) {
this.time = value;
} }
public String getObservations() {
return observations;
}
public void setObservations(String observation) {
this.observations = observations;
}
/**
* 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;
}
}