Commit 03a13c52 by Amparo Oliver

spring.jpa.hibernate.ddl-auto=update

parent 1740891f
......@@ -43,16 +43,24 @@ public class CurriculumsearchApplication {
guardarJson(ciudR,"/json/Ciudad.json",Ciudad.class);
guardarJson(tecRepo,"/json/tecnologia.json",Tecnologia.class);
guardarJson(insR,"/json/institucion.json",Institucion.class);
guardarJson(postRepo,"/json/postulante.json",Postulante.class);
//guardarJson(postRepo,"/json/postulante.json",Postulante.class);
String password = new BCryptPasswordEncoder().encode("test");
RRHHUser testuser = new RRHHUser();
testuser.setEmail("test@test.com");
testuser.setFirstName("test");
testuser.setLastName("test");
testuser.setPassword(password);
rrhhUserRepository.save(testuser);
System.out.println("Usuario Test: \nEmail: test@test.com\nPassword: test");
String testEmail = "test@test.com";
// Check if the user with the email already exists before saving
RRHHUser existingUser = rrhhUserRepository.findByEmail(testEmail);
if (existingUser == null) {
RRHHUser testuser = new RRHHUser();
testuser.setEmail(testEmail);
testuser.setFirstName("test");
testuser.setLastName("test");
testuser.setPassword(password);
rrhhUserRepository.save(testuser);
System.out.println("Usuario Test: \nEmail: " + testEmail + "\nPassword: test");
} else {
System.out.println("User with email " + testEmail + " already exists.");
}
} catch (IOException e){
System.out.println("Unable to save: " + e.getMessage());
......
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.hibernate.ddl-auto=update
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
#spring.jpa.show-sql=true
#spring.jpa.properties.hibernate.format_sql=true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment