Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
th-app-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oscar Enrique Gonzalez Escurra
th-app-java
Commits
83013cc5
You need to sign in or sign up before continuing.
Commit
83013cc5
authored
Nov 04, 2021
by
Cesar Giulano Gonzalez Maqueda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modificacion del modelo de estudio y creacion de modelos de institucion y tipodeestudio
parent
7b2e1fe1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
94 additions
and
156 deletions
+94
-156
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
+2
-11
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
+40
-58
curriculumsearch/src/main/java/com/roshka/modelo/EstudioReconocimiento.java
+0
-76
curriculumsearch/src/main/java/com/roshka/modelo/Institucion.java
+27
-0
curriculumsearch/src/main/java/com/roshka/modelo/TipoDeEstudio.java
+25
-0
curriculumsearch/src/main/java/com/roshka/repositorio/EstudioReconocimientoRepository.java
+0
-11
No files found.
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
View file @
83013cc5
...
@@ -32,13 +32,10 @@ public class PostulanteController {
...
@@ -32,13 +32,10 @@ public class PostulanteController {
@Autowired
@Autowired
ExperienciaRepository
expRepo
;
ExperienciaRepository
expRepo
;
@RequestMapping
(
"/"
)
@RequestMapping
(
"/"
)
public
String
index
()
{
public
String
index
()
{
List
<
Postulante
>
j
=
post
.
personasConExperienciaMayor
(
30
);
for
(
Postulante
postulante
:
j
)
{
System
.
out
.
println
(
postulante
.
getNombre
());
}
return
"index"
;
return
"index"
;
}
}
...
@@ -61,12 +58,6 @@ public class PostulanteController {
...
@@ -61,12 +58,6 @@ public class PostulanteController {
@PostMapping
(
value
=
"/postulante"
,
consumes
=
"application/json"
)
@PostMapping
(
value
=
"/postulante"
,
consumes
=
"application/json"
)
public
String
guardarPostulante
(
@RequestBody
Postulante
postulante
){
public
String
guardarPostulante
(
@RequestBody
Postulante
postulante
){
//se obtiene referencia de todas las tecnologias existentes
postulante
.
getTecnologias
().
stream
().
filter
(
tec
->
tec
.
getTecnologia
().
getId
()
!=
0
).
forEach
(
tec
->
tec
.
setTecnologia
(
tecRepo
.
getById
(
tec
.
getTecnologia
().
getId
()))
);
post
.
save
(
postulante
);
post
.
save
(
postulante
);
return
"redirect:/"
;
return
"redirect:/"
;
}
}
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
View file @
83013cc5
...
@@ -3,16 +3,7 @@ package com.roshka.modelo;
...
@@ -3,16 +3,7 @@ package com.roshka.modelo;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
javax.persistence.CascadeType
;
import
javax.persistence.*
;
import
javax.persistence.Column
;
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.OneToMany
;
import
javax.persistence.Table
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Past
;
import
javax.validation.constraints.Past
;
...
@@ -28,13 +19,24 @@ public class Estudio {
...
@@ -28,13 +19,24 @@ public class Estudio {
@Column
(
name
=
"id"
)
@Column
(
name
=
"id"
)
private
long
id
;
private
long
id
;
@Column
(
name
=
"tipo_de_studio"
)
@ManyToOne
(
fetch
=
FetchType
.
EAGER
)
@NotNull
(
message
=
"Este campo no puede ser null"
)
@JsonBackReference
private
TipoDeEstudio
tipoDeEstudio
;
@NotNull
(
message
=
"Este campo no puede estar vacio"
)
@ManyToOne
(
fetch
=
FetchType
.
EAGER
)
@JsonBackReference
private
Institucion
institucion
;
@Column
(
name
=
"estado"
)
@NotBlank
(
message
=
"Este campo no puede estar vacio"
)
@NotBlank
(
message
=
"Este campo no puede estar vacio"
)
private
String
tipoDeEstudi
o
;
private
String
estad
o
;
@Column
(
name
=
"institucion"
)
//Carrera, Bachiller
@Column
(
name
=
"tema_de_estudio"
)
@NotBlank
(
message
=
"Este campo no puede estar vacio"
)
@NotBlank
(
message
=
"Este campo no puede estar vacio"
)
private
String
institucion
;
private
String
temaDeEstudio
;
@Column
(
name
=
"fecha_desde"
)
@Column
(
name
=
"fecha_desde"
)
@NotNull
(
message
=
"Este campo no puede estar vacio"
)
@NotNull
(
message
=
"Este campo no puede estar vacio"
)
...
@@ -44,28 +46,11 @@ public class Estudio {
...
@@ -44,28 +46,11 @@ public class Estudio {
@Column
(
name
=
"fecha_hasta"
)
@Column
(
name
=
"fecha_hasta"
)
private
Date
fechaHasta
;
private
Date
fechaHasta
;
@Column
(
name
=
"titulo"
)
@NotBlank
(
message
=
"Este campo no puede estar vacio"
)
private
String
titulo
;
@ManyToOne
@ManyToOne
@JoinColumn
@JoinColumn
@JsonBackReference
@JsonBackReference
private
Postulante
postulante
;
private
Postulante
postulante
;
@JsonManagedReference
@OneToMany
(
mappedBy
=
"estudio"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
EstudioReconocimiento
>
estudioReconocimiento
;
public
List
<
EstudioReconocimiento
>
getEstudioReconocimiento
()
{
return
estudioReconocimiento
;
}
public
void
setEstudioReconocimiento
(
List
<
EstudioReconocimiento
>
estudioReconocimiento
)
{
this
.
estudioReconocimiento
=
estudioReconocimiento
;
}
public
Postulante
getPostulante
()
{
public
Postulante
getPostulante
()
{
return
postulante
;
return
postulante
;
...
@@ -82,54 +67,51 @@ public class Estudio {
...
@@ -82,54 +67,51 @@ public class Estudio {
this
.
fechaHasta
=
Helper
.
convertirFecha
(
fechaHasta
);
this
.
fechaHasta
=
Helper
.
convertirFecha
(
fechaHasta
);
}
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
public
long
getId
()
{
return
this
.
id
;
}
}
public
void
setTipoDeEstudio
(
TipoDeEstudio
tipoDeEstudio
)
{
public
void
setId
(
long
id
)
{
this
.
tipoDeEstudio
=
tipoDeEstudio
;
this
.
id
=
id
;
}
}
public
String
getTipoDeEstudio
(
)
{
public
void
setInstitucion
(
Institucion
institucion
)
{
return
this
.
tipoDeEstudio
;
this
.
institucion
=
institucion
;
}
}
public
void
set
TipoDeEstudio
(
String
tipoDeEstudi
o
)
{
public
void
set
Estado
(
String
estad
o
)
{
this
.
tipoDeEstudio
=
tipoDeEstudi
o
;
this
.
estado
=
estad
o
;
}
}
public
String
getInstitucion
(
)
{
public
void
setTemaDeEstudio
(
String
temaDeEstudio
)
{
return
this
.
institucion
;
this
.
temaDeEstudio
=
temaDeEstudio
;
}
}
public
void
setInstitucion
(
String
institucion
)
{
public
long
getId
(
)
{
this
.
institucion
=
institucion
;
return
id
;
}
}
public
Date
getFechaDesde
()
{
public
TipoDeEstudio
getTipoDeEstudio
()
{
return
t
his
.
fechaDesde
;
return
t
ipoDeEstudio
;
}
}
public
void
setFechaDesde
(
Date
fechaDesde
)
{
public
Institucion
getInstitucion
(
)
{
this
.
fechaDesde
=
fechaDesde
;
return
institucion
;
}
}
public
Date
getFechaHasta
()
{
public
String
getEstado
()
{
return
this
.
fechaHasta
;
return
estado
;
}
}
public
void
setFechaHasta
(
Date
fechaHasta
)
{
public
String
getTemaDeEstudio
(
)
{
this
.
fechaHasta
=
fechaHasta
;
return
temaDeEstudio
;
}
}
public
String
getTitulo
()
{
public
Date
getFechaDesde
()
{
return
this
.
titulo
;
return
fechaDesde
;
}
}
public
void
setTitulo
(
String
titulo
)
{
public
Date
getFechaHasta
(
)
{
this
.
titulo
=
titulo
;
return
fechaHasta
;
}
}
}
}
curriculumsearch/src/main/java/com/roshka/modelo/EstudioReconocimiento.java
deleted
100644 → 0
View file @
7b2e1fe1
package
com
.
roshka
.
modelo
;
import
javax.persistence.Column
;
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
javax.validation.constraints.NotBlank
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
@Entity
@Table
(
name
=
"estudio_reconocimiento"
)
public
class
EstudioReconocimiento
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@Column
(
name
=
"id"
)
private
Long
id
;
@Column
(
name
=
"nombre"
)
@NotBlank
(
message
=
"Este campo no puede estar vacio"
)
private
String
nombre
;
@Column
(
name
=
"certificado"
)
@NotBlank
(
message
=
"Este campo no puede estar vacio"
)
private
String
certificado
;
@JsonBackReference
@ManyToOne
@JoinColumn
private
Estudio
estudio
;
public
EstudioReconocimiento
()
{
}
public
EstudioReconocimiento
(
Long
id
,
String
nombre
,
String
certificado
)
{
this
.
id
=
id
;
this
.
nombre
=
nombre
;
this
.
certificado
=
certificado
;
}
public
Long
getId
()
{
return
this
.
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getNombre
()
{
return
this
.
nombre
;
}
public
void
setNombre
(
String
nombre
)
{
this
.
nombre
=
nombre
;
}
public
String
getCertificado
()
{
return
this
.
certificado
;
}
public
void
setCertificado
(
String
certificado
)
{
this
.
certificado
=
certificado
;
}
public
Estudio
getEstudio
()
{
return
estudio
;
}
public
void
setEstudio
(
Estudio
estudio
)
{
this
.
estudio
=
estudio
;
}
}
curriculumsearch/src/main/java/com/roshka/modelo/Institucion.java
0 → 100644
View file @
83013cc5
package
com
.
roshka
.
modelo
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
import
javax.persistence.*
;
import
javax.validation.constraints.NotBlank
;
import
java.util.List
;
@Entity
@Table
(
name
=
"institucion"
)
public
class
Institucion
{
@Id
@Column
(
name
=
"id"
)
private
long
id
;
@Column
(
name
=
"nombre"
)
@NotBlank
private
String
nombre
;
//Facultades
@Column
(
name
=
"sub_nombre"
)
private
String
subNombre
;
@OneToMany
(
cascade
=
CascadeType
.
PERSIST
,
mappedBy
=
"institucion"
,
fetch
=
FetchType
.
LAZY
)
@JsonManagedReference
private
List
<
Estudio
>
estudioList
;
}
curriculumsearch/src/main/java/com/roshka/modelo/TipoDeEstudio.java
0 → 100644
View file @
83013cc5
package
com
.
roshka
.
modelo
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
import
javax.persistence.*
;
import
javax.validation.constraints.NotBlank
;
import
java.util.List
;
@Entity
@Table
(
name
=
"tipo_de_estudio"
)
public
class
TipoDeEstudio
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@Column
(
name
=
"id"
)
private
long
id
;
@Column
(
name
=
"nombre"
)
@NotBlank
(
message
=
"Este campo no puede estar vacio"
)
private
String
nombre
;
@OneToMany
(
cascade
=
CascadeType
.
PERSIST
,
mappedBy
=
"tipoDeEstudio"
,
fetch
=
FetchType
.
LAZY
)
@JsonManagedReference
private
List
<
Estudio
>
estudioList
;
}
curriculumsearch/src/main/java/com/roshka/repositorio/EstudioReconocimientoRepository.java
deleted
100644 → 0
View file @
7b2e1fe1
package
com
.
roshka
.
repositorio
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
com.roshka.modelo.EstudioReconocimiento
;
public
interface
EstudioReconocimientoRepository
extends
JpaRepository
<
EstudioReconocimiento
,
Long
>{
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment