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
0
Merge Requests
0
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
Amparo Oliver
th-app-java
Commits
14988be1
Commit
14988be1
authored
Nov 10, 2021
by
Joel Florentin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
identity en id de los modelos.
parent
e1ff3f2b
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
27 additions
and
20 deletions
+27
-20
curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java
+12
-5
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
+3
-3
curriculumsearch/src/main/java/com/roshka/modelo/Cargo.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/ConvocatoriaCargo.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/Institucion.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
+2
-2
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
+2
-2
curriculumsearch/src/main/java/com/roshka/modelo/RRHHUser.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/ReferenciaPersonal.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/Tecnologia.java
+1
-1
No files found.
curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java
View file @
14988be1
...
...
@@ -2,6 +2,7 @@ package com.roshka;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.fasterxml.jackson.core.type.TypeReference
;
...
...
@@ -51,23 +52,29 @@ public class CurriculumsearchApplication {
cargoR
.
saveAll
(
cargos
);
cargoR
.
flush
();
System
.
out
.
println
(
"Cargos Saved!"
);
/* TypeReference<List<Tecnologia>> typeReference5 = new TypeReference<List<Tecnologia>>(){};
inputStream = TypeReference.class.getResourceAsStream("/json/tecnologia.json");
List<Tecnologia> tecnologias= mapper.readValue(inputStream,typeReference5);
tecRepo.saveAll(tecnologias);
tecRepo.flush();
System.out.println("Cargos Saved!"); */
TypeReference
<
List
<
ConvocatoriaCargo
>>
typeReference4
=
new
TypeReference
<
List
<
ConvocatoriaCargo
>>(){};
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/convocatoria.json"
);
List
<
ConvocatoriaCargo
>
convocatorias
=
mapper
.
readValue
(
inputStream
,
typeReference4
);
convR
.
saveAll
(
convocatorias
);
conv
ocatorias
=
conv
R
.
saveAll
(
convocatorias
);
convR
.
flush
();
System
.
out
.
println
(
"convocatorias Saved!"
);
TypeReference
<
List
<
Postulante
>>
typeReference
=
new
TypeReference
<
List
<
Postulante
>>(){};
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/postulante.json"
);
List
<
Postulante
>
postulantes
=
mapper
.
readValue
(
inputStream
,
typeReference
);
/* for (Postulante postulante : postulantes) {
/*
for (Postulante postulante : postulantes) {
for (int i = 0; i < postulante.getPostulaciones().size(); i++) {
postulante.getPostulaciones().set(i, convR.getById(postulante.getPostulaciones().get(i).getId()));
postulante.getPostulaciones().get(i).getFechaInicio();
}
} */
}
*/
postRepo
.
saveAll
(
postulantes
);
System
.
out
.
println
(
"postulantes Saved!"
);
String
password
=
new
BCryptPasswordEncoder
().
encode
(
"test"
);
...
...
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
View file @
14988be1
...
...
@@ -144,13 +144,13 @@ public class PostulanteController {
tec
->
tec
.
getTecnologia
().
getId
()
!=
0
).
forEach
(
tec
->
tec
.
setTecnologia
(
tecRepo
.
getById
(
tec
.
getTecnologia
().
getId
()))
);
);
for
(
int
i
=
0
;
i
<
postulante
.
getPostulaciones
().
size
();
i
++)
{
/*
for (int i = 0; i < postulante.getPostulaciones().size(); i++) {
postulante.getPostulaciones().set(i, cargoRepo.getById(postulante.getPostulaciones().get(i).getId()));
}
*/
for
(
Estudio
estudio:
postulante
.
getEstudios
()){
String
nombreIns
=
""
;
nombreIns
=
estudio
.
getInstitucion
().
getNombre
().
toLowerCase
();
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Cargo.java
View file @
14988be1
...
...
@@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonManagedReference;
@Table
(
name
=
"cargo"
)
public
class
Cargo
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
@NotBlank
...
...
curriculumsearch/src/main/java/com/roshka/modelo/ConvocatoriaCargo.java
View file @
14988be1
...
...
@@ -24,7 +24,7 @@ import com.roshka.utils.Helper;
@JsonIdentityInfo
(
generator
=
ObjectIdGenerators
.
UUIDGenerator
.
class
,
property
=
"@UUID"
)
public
class
ConvocatoriaCargo
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
@ManyToOne
()
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
View file @
14988be1
...
...
@@ -15,7 +15,7 @@ import com.roshka.utils.Helper;
@Table
(
name
=
"estudio"
)
public
class
Estudio
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
private
long
id
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
View file @
14988be1
...
...
@@ -23,7 +23,7 @@ import javax.validation.constraints.Past;
@Table
(
name
=
"experiencia"
)
public
class
Experiencia
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
long
id
;
@Column
(
name
=
"institucion"
)
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Institucion.java
View file @
14988be1
...
...
@@ -10,7 +10,7 @@ import java.util.List;
@Table
(
name
=
"institucion"
)
public
class
Institucion
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
private
long
id
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
View file @
14988be1
...
...
@@ -19,7 +19,7 @@ import java.util.List;
@JsonIdentityInfo
(
generator
=
ObjectIdGenerators
.
UUIDGenerator
.
class
,
property
=
"@UUID"
)
public
class
Postulante
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
private
long
id
;
...
...
@@ -101,7 +101,7 @@ public class Postulante {
@OneToMany
(
mappedBy
=
"postulante"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
ReferenciaPersonal
>
referencias
;
@ManyToMany
(
cascade
=
CascadeType
.
ALL
)
@ManyToMany
()
@JoinTable
(
uniqueConstraints
=
@UniqueConstraint
(
columnNames
=
{
"postulante_id"
,
"convocatoria_cargo_id"
}),
joinColumns
=
@JoinColumn
(
name
=
"postulante_id"
,
referencedColumnName
=
"id"
),
inverseJoinColumns
=
@JoinColumn
(
name
=
"convocatoria_cargo_id"
,
referencedColumnName
=
"id"
)
...
...
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
View file @
14988be1
...
...
@@ -21,7 +21,7 @@ uniqueConstraints=@UniqueConstraint(columnNames={"postulante_id", "tecnologia_id
public
class
PostulanteTecnologia
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
private
long
id
;
...
...
@@ -29,7 +29,7 @@ public class PostulanteTecnologia {
@Min
(
value
=
1
)
@Max
(
value
=
5
)
private
Long
nivel
;
@ManyToOne
(
cascade
=
{
CascadeType
.
PERSIST
,
CascadeType
.
MERGE
},
optional
=
false
)
@ManyToOne
(
cascade
=
{
CascadeType
.
PERSIST
},
optional
=
false
)
@JoinColumn
private
Tecnologia
tecnologia
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/RRHHUser.java
View file @
14988be1
...
...
@@ -6,7 +6,7 @@ import javax.persistence.*;
@Table
(
name
=
"recursos_humanos_user"
)
public
class
RRHHUser
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
@Column
(
nullable
=
false
,
unique
=
true
,
length
=
45
)
...
...
curriculumsearch/src/main/java/com/roshka/modelo/ReferenciaPersonal.java
View file @
14988be1
...
...
@@ -16,7 +16,7 @@ import com.fasterxml.jackson.annotation.JsonBackReference;
@Table
(
name
=
"referencia_personal"
)
public
class
ReferenciaPersonal
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
@NotBlank
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Tecnologia.java
View file @
14988be1
...
...
@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank;
@Entity
@Table
(
name
=
"tecnologia"
)
public
class
Tecnologia
{
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Id
@Column
(
name
=
"id"
)
private
long
id
;
...
...
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