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;
...
@@ -2,6 +2,7 @@ package com.roshka;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.core.type.TypeReference
;
...
@@ -51,23 +52,29 @@ public class CurriculumsearchApplication {
...
@@ -51,23 +52,29 @@ public class CurriculumsearchApplication {
cargoR
.
saveAll
(
cargos
);
cargoR
.
saveAll
(
cargos
);
cargoR
.
flush
();
cargoR
.
flush
();
System
.
out
.
println
(
"Cargos Saved!"
);
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
>>(){};
TypeReference
<
List
<
ConvocatoriaCargo
>>
typeReference4
=
new
TypeReference
<
List
<
ConvocatoriaCargo
>>(){};
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/convocatoria.json"
);
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/convocatoria.json"
);
List
<
ConvocatoriaCargo
>
convocatorias
=
mapper
.
readValue
(
inputStream
,
typeReference4
);
List
<
ConvocatoriaCargo
>
convocatorias
=
mapper
.
readValue
(
inputStream
,
typeReference4
);
convR
.
saveAll
(
convocatorias
);
conv
ocatorias
=
conv
R
.
saveAll
(
convocatorias
);
convR
.
flush
();
convR
.
flush
();
System
.
out
.
println
(
"convocatorias Saved!"
);
System
.
out
.
println
(
"convocatorias Saved!"
);
TypeReference
<
List
<
Postulante
>>
typeReference
=
new
TypeReference
<
List
<
Postulante
>>(){};
TypeReference
<
List
<
Postulante
>>
typeReference
=
new
TypeReference
<
List
<
Postulante
>>(){};
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/postulante.json"
);
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/postulante.json"
);
List
<
Postulante
>
postulantes
=
mapper
.
readValue
(
inputStream
,
typeReference
);
List
<
Postulante
>
postulantes
=
mapper
.
readValue
(
inputStream
,
typeReference
);
/* for (Postulante postulante : postulantes) {
/*
for (Postulante postulante : postulantes) {
for (int i = 0; i < postulante.getPostulaciones().size(); i++) {
for (int i = 0; i < postulante.getPostulaciones().size(); i++) {
postulante.getPostulaciones().set(i, convR.getById(postulante.getPostulaciones().get(i).getId()));
postulante.getPostulaciones().set(i, convR.getById(postulante.getPostulaciones().get(i).getId()));
postulante.getPostulaciones().get(i).getFechaInicio();
}
}
} */
}
*/
postRepo
.
saveAll
(
postulantes
);
postRepo
.
saveAll
(
postulantes
);
System
.
out
.
println
(
"postulantes Saved!"
);
System
.
out
.
println
(
"postulantes Saved!"
);
String
password
=
new
BCryptPasswordEncoder
().
encode
(
"test"
);
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 {
...
@@ -144,13 +144,13 @@ public class PostulanteController {
tec
->
tec
.
getTecnologia
().
getId
()
!=
0
tec
->
tec
.
getTecnologia
().
getId
()
!=
0
).
forEach
(
).
forEach
(
tec
->
tec
.
setTecnologia
(
tecRepo
.
getById
(
tec
.
getTecnologia
().
getId
()))
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()));
postulante.getPostulaciones().set(i, cargoRepo.getById(postulante.getPostulaciones().get(i).getId()));
}
}
*/
for
(
Estudio
estudio:
postulante
.
getEstudios
()){
for
(
Estudio
estudio:
postulante
.
getEstudios
()){
String
nombreIns
=
""
;
String
nombreIns
=
""
;
nombreIns
=
estudio
.
getInstitucion
().
getNombre
().
toLowerCase
();
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;
...
@@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonManagedReference;
@Table
(
name
=
"cargo"
)
@Table
(
name
=
"cargo"
)
public
class
Cargo
{
public
class
Cargo
{
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
private
Long
id
;
@NotBlank
@NotBlank
...
...
curriculumsearch/src/main/java/com/roshka/modelo/ConvocatoriaCargo.java
View file @
14988be1
...
@@ -24,7 +24,7 @@ import com.roshka.utils.Helper;
...
@@ -24,7 +24,7 @@ import com.roshka.utils.Helper;
@JsonIdentityInfo
(
generator
=
ObjectIdGenerators
.
UUIDGenerator
.
class
,
property
=
"@UUID"
)
@JsonIdentityInfo
(
generator
=
ObjectIdGenerators
.
UUIDGenerator
.
class
,
property
=
"@UUID"
)
public
class
ConvocatoriaCargo
{
public
class
ConvocatoriaCargo
{
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
private
Long
id
;
@ManyToOne
()
@ManyToOne
()
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
View file @
14988be1
...
@@ -15,7 +15,7 @@ import com.roshka.utils.Helper;
...
@@ -15,7 +15,7 @@ import com.roshka.utils.Helper;
@Table
(
name
=
"estudio"
)
@Table
(
name
=
"estudio"
)
public
class
Estudio
{
public
class
Estudio
{
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
@Column
(
name
=
"id"
)
private
long
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;
...
@@ -23,7 +23,7 @@ import javax.validation.constraints.Past;
@Table
(
name
=
"experiencia"
)
@Table
(
name
=
"experiencia"
)
public
class
Experiencia
{
public
class
Experiencia
{
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
long
id
;
private
long
id
;
@Column
(
name
=
"institucion"
)
@Column
(
name
=
"institucion"
)
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Institucion.java
View file @
14988be1
...
@@ -10,7 +10,7 @@ import java.util.List;
...
@@ -10,7 +10,7 @@ import java.util.List;
@Table
(
name
=
"institucion"
)
@Table
(
name
=
"institucion"
)
public
class
Institucion
{
public
class
Institucion
{
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
@Column
(
name
=
"id"
)
private
long
id
;
private
long
id
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
View file @
14988be1
...
@@ -19,7 +19,7 @@ import java.util.List;
...
@@ -19,7 +19,7 @@ import java.util.List;
@JsonIdentityInfo
(
generator
=
ObjectIdGenerators
.
UUIDGenerator
.
class
,
property
=
"@UUID"
)
@JsonIdentityInfo
(
generator
=
ObjectIdGenerators
.
UUIDGenerator
.
class
,
property
=
"@UUID"
)
public
class
Postulante
{
public
class
Postulante
{
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
@Column
(
name
=
"id"
)
private
long
id
;
private
long
id
;
...
@@ -101,7 +101,7 @@ public class Postulante {
...
@@ -101,7 +101,7 @@ public class Postulante {
@OneToMany
(
mappedBy
=
"postulante"
,
cascade
=
CascadeType
.
ALL
)
@OneToMany
(
mappedBy
=
"postulante"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
ReferenciaPersonal
>
referencias
;
private
List
<
ReferenciaPersonal
>
referencias
;
@ManyToMany
(
cascade
=
CascadeType
.
ALL
)
@ManyToMany
()
@JoinTable
(
uniqueConstraints
=
@UniqueConstraint
(
columnNames
=
{
"postulante_id"
,
"convocatoria_cargo_id"
}),
@JoinTable
(
uniqueConstraints
=
@UniqueConstraint
(
columnNames
=
{
"postulante_id"
,
"convocatoria_cargo_id"
}),
joinColumns
=
@JoinColumn
(
name
=
"postulante_id"
,
referencedColumnName
=
"id"
),
joinColumns
=
@JoinColumn
(
name
=
"postulante_id"
,
referencedColumnName
=
"id"
),
inverseJoinColumns
=
@JoinColumn
(
name
=
"convocatoria_cargo_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
...
@@ -21,7 +21,7 @@ uniqueConstraints=@UniqueConstraint(columnNames={"postulante_id", "tecnologia_id
public
class
PostulanteTecnologia
{
public
class
PostulanteTecnologia
{
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
@Column
(
name
=
"id"
)
private
long
id
;
private
long
id
;
...
@@ -29,7 +29,7 @@ public class PostulanteTecnologia {
...
@@ -29,7 +29,7 @@ public class PostulanteTecnologia {
@Min
(
value
=
1
)
@Min
(
value
=
1
)
@Max
(
value
=
5
)
@Max
(
value
=
5
)
private
Long
nivel
;
private
Long
nivel
;
@ManyToOne
(
cascade
=
{
CascadeType
.
PERSIST
,
CascadeType
.
MERGE
},
optional
=
false
)
@ManyToOne
(
cascade
=
{
CascadeType
.
PERSIST
},
optional
=
false
)
@JoinColumn
@JoinColumn
private
Tecnologia
tecnologia
;
private
Tecnologia
tecnologia
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/RRHHUser.java
View file @
14988be1
...
@@ -6,7 +6,7 @@ import javax.persistence.*;
...
@@ -6,7 +6,7 @@ import javax.persistence.*;
@Table
(
name
=
"recursos_humanos_user"
)
@Table
(
name
=
"recursos_humanos_user"
)
public
class
RRHHUser
{
public
class
RRHHUser
{
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
private
Long
id
;
@Column
(
nullable
=
false
,
unique
=
true
,
length
=
45
)
@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;
...
@@ -16,7 +16,7 @@ import com.fasterxml.jackson.annotation.JsonBackReference;
@Table
(
name
=
"referencia_personal"
)
@Table
(
name
=
"referencia_personal"
)
public
class
ReferenciaPersonal
{
public
class
ReferenciaPersonal
{
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
private
Long
id
;
@NotBlank
@NotBlank
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Tecnologia.java
View file @
14988be1
...
@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank;
...
@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank;
@Entity
@Entity
@Table
(
name
=
"tecnologia"
)
@Table
(
name
=
"tecnologia"
)
public
class
Tecnologia
{
public
class
Tecnologia
{
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Id
@Id
@Column
(
name
=
"id"
)
@Column
(
name
=
"id"
)
private
long
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