diff --git a/curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java b/curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java index eadf86f..87228d1 100644 --- a/curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java +++ b/curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java @@ -10,12 +10,14 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; import javax.persistence.Table; @Entity @Table(name="estudio") public class Estudio { @Id - @GeneratedValue(strategy=GenerationType.IDENTITY) + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="id") private long id; @Column(name="tipo_de_studio") private String tipoDeEstudio; @@ -34,8 +36,7 @@ public class Estudio { @JoinColumn private Postulante postulante; - @ManyToOne - @JoinColumn + @OneToMany(mappedBy = "estudio") private List estudioReconocimiento; diff --git a/curriculumsearch/src/main/java/com/roshka/modelo/EstudioReconocimiento.java b/curriculumsearch/src/main/java/com/roshka/modelo/EstudioReconocimiento.java index 8a657cb..47b92a1 100644 --- a/curriculumsearch/src/main/java/com/roshka/modelo/EstudioReconocimiento.java +++ b/curriculumsearch/src/main/java/com/roshka/modelo/EstudioReconocimiento.java @@ -15,6 +15,7 @@ import javax.persistence.Table; public class EstudioReconocimiento { @Id @GeneratedValue(strategy=GenerationType.AUTO) + @Column(name="id") private Long id; @Column(name="nombre") private String nombre; @@ -22,15 +23,8 @@ public class EstudioReconocimiento { private String certificado; @ManyToOne @JoinColumn - private Postulante postulante; + private Estudio estudio; - public Postulante getPostulante() { - return postulante; - } - - public void setPostulante(Postulante postulante) { - this.postulante = postulante; - } public EstudioReconocimiento(Long id, String nombre, String certificado) { this.id = id; @@ -61,4 +55,10 @@ public class EstudioReconocimiento { public void setCertificado(String certificado) { this.certificado = certificado; } + public Estudio getEstudio() { + return estudio; + } + public void setEstudio(Estudio estudio) { + this.estudio = estudio; + } } diff --git a/curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java b/curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java index 5f5a687..00a01c9 100644 --- a/curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java +++ b/curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java @@ -24,6 +24,9 @@ public class Experiencia { private String referencias; @Column(name = "cargo") private String cargo; + @ManyToOne + @JoinColumn + private Postulante postulante; public long getId() { return id; @@ -61,5 +64,10 @@ public class Experiencia { public void setCargo(String cargo) { this.cargo = cargo; } - + public void setPostulante(Postulante postulante) { + this.postulante = postulante; + } + public Postulante getPostulante() { + return postulante; + } } diff --git a/curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaReconocimiento.java b/curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaReconocimiento.java index 1d8d918..83a1f36 100644 --- a/curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaReconocimiento.java +++ b/curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaReconocimiento.java @@ -7,11 +7,13 @@ import javax.persistence.*; public class ExperienciaReconocimiento { @Id @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name="id") private long id; - @Column(name ="experiencia_id") - private long experienciaId; - @Column(name = "tecnologia_id") - private long tecnologiaId; + + @ManyToOne + @JoinColumn + private Experiencia experiencia; + @Column(name = "nivel") private long nivel; @@ -21,17 +23,11 @@ public class ExperienciaReconocimiento { public void setId(long id) { this.id = id; } - public long getExperienciaId() { - return experienciaId; + public Experiencia getExperiencia() { + return experiencia; } - public void setExperienciaId(long experienciaId) { - this.experienciaId = experienciaId; - } - public long getTecnologiaId() { - return tecnologiaId; - } - public void setTecnologiaId(long tecnologiaId) { - this.tecnologiaId = tecnologiaId; + public void setExperiencia(Experiencia experiencia) { + this.experiencia = experiencia; } public long getNivel() { return nivel; diff --git a/curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaTecnologia.java b/curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaTecnologia.java index 2747d58..cb5d42a 100644 --- a/curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaTecnologia.java +++ b/curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaTecnologia.java @@ -1,5 +1,6 @@ package com.roshka.modelo; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; @@ -13,6 +14,7 @@ import javax.persistence.Table; public class ExperienciaTecnologia { @Id @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name="id") private Long id; @ManyToOne @@ -23,6 +25,7 @@ public class ExperienciaTecnologia { @JoinColumn private Tecnologia tecnologia; + @Column(name="nivel") private Long nivel; public Long getId() { diff --git a/curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java b/curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java index f4bb4eb..cc4c33c 100644 --- a/curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java +++ b/curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java @@ -10,6 +10,7 @@ import java.util.List; public class Postulante { @Id @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name="id") private long id; @Column(name="nombre") @@ -49,15 +50,12 @@ public class Postulante { private String disponibilidad; @OneToMany(mappedBy = "postulante") - @JoinColumn() private List tecnologias; @OneToMany(mappedBy = "postulante") - @JoinColumn() private List experiencias; @OneToMany(mappedBy = "postulante") - @JoinColumn private List estudios; public long getId() { diff --git a/curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java b/curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java index db4416a..a22ce03 100644 --- a/curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java +++ b/curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java @@ -14,14 +14,13 @@ import javax.persistence.Table; public class PostulanteTecnologia { @Id @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name="id") private long id ; @Column(name="nivel") private Long nivel; - @Column(name="tecnologia") @ManyToOne() @JoinColumn private Tecnologia tecnologia; - @Column(name="postulante") @ManyToOne() @JoinColumn private Postulante postulante;