TO y JPA
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
package TO;
|
package TO;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
* @author Roberto Orden Erena <rorden@uoc.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "MedicalTest")
|
@XmlRootElement(name = "MedicalTest")
|
||||||
@@ -14,10 +15,107 @@ public class MedicalTestTO implements Serializable {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
private Date date;
|
||||||
|
private long time;
|
||||||
|
private String observations;
|
||||||
|
private String highresimage;
|
||||||
|
private int type;
|
||||||
|
private PatientTO patient;
|
||||||
|
private SpecialistDoctorTO specialistDoctor;
|
||||||
|
|
||||||
|
public MedicalTestTO(int id, Date date, int time, String observations, String highresimage, int type, PatientTO patiend, SpecialistDoctorTO specialistDoctor) {
|
||||||
|
this.setId(id);
|
||||||
|
this.setDate(date);
|
||||||
|
this.setTime(time);
|
||||||
|
this.setObservations(observations);
|
||||||
|
this.setHighresimage(highresimage);
|
||||||
|
this.setType(type);
|
||||||
|
this.setPatient(patiend);
|
||||||
|
this.setSpecialistDoctor(specialistDoctor);
|
||||||
|
|
||||||
public MedicalTestTO() {
|
|
||||||
super();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Date getDate() {
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setDate(Date date) {
|
||||||
|
this.date = date;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setTime(long time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getObservations() {
|
||||||
|
return observations;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setObservations(String observations) {
|
||||||
|
this.observations = observations;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getHighresimage() {
|
||||||
|
return highresimage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setHighresimage(String highresimage) {
|
||||||
|
this.highresimage = highresimage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public PatientTO getPatient() {
|
||||||
|
return patient;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setPatient(PatientTO patient) {
|
||||||
|
this.patient = patient;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public SpecialistDoctorTO getSpecialistDoctor() {
|
||||||
|
return specialistDoctor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setSpecialistDoctor(SpecialistDoctorTO specialistDoctor) {
|
||||||
|
this.specialistDoctor = specialistDoctor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
127
1.sources/MyHealth/src/jpa/MedicalTestJPA.java
Normal file
127
1.sources/MyHealth/src/jpa/MedicalTestJPA.java
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
package jpa;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
import TO.PatientTO;
|
||||||
|
import TO.SpecialistDoctorTO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "MyHealth.MedicalTest")
|
||||||
|
public class MedicalTestJPA implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||||
|
private int id;
|
||||||
|
private Date date;
|
||||||
|
private long time;
|
||||||
|
private String observations;
|
||||||
|
private String highresimage;
|
||||||
|
private int type;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn (name="PatientId")
|
||||||
|
private PatientTO patient;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn (name="SpecialistDoctorId")
|
||||||
|
private SpecialistDoctorTO specialistDoctor;
|
||||||
|
|
||||||
|
public MedicalTestJPA() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MedicalTestJPA(int id, Date date, long time, String observations, String highresimage, int type,
|
||||||
|
PatientTO patient, SpecialistDoctorTO specialistDoctor) {
|
||||||
|
this.id = id;
|
||||||
|
this.date = date;
|
||||||
|
this.time = time;
|
||||||
|
this.observations = observations;
|
||||||
|
this.highresimage = highresimage;
|
||||||
|
this.type = type;
|
||||||
|
this.patient = patient;
|
||||||
|
this.specialistDoctor = specialistDoctor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDate() {
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDate(Date date) {
|
||||||
|
this.date = date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(long time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getObservations() {
|
||||||
|
return observations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setObservations(String observations) {
|
||||||
|
this.observations = observations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHighresimage() {
|
||||||
|
return highresimage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHighresimage(String highresimage) {
|
||||||
|
this.highresimage = highresimage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PatientTO getPatient() {
|
||||||
|
return patient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPatient(PatientTO patient) {
|
||||||
|
this.patient = patient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SpecialistDoctorTO getSpecialistDoctor() {
|
||||||
|
return specialistDoctor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpecialistDoctor(SpecialistDoctorTO specialistDoctor) {
|
||||||
|
this.specialistDoctor = specialistDoctor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user