I am finding the following difficulties trying to configure Spring Data JPA into my Spring Boot project.
I have the following problem related to the application.properties file. This is my original application.properties file content:
spring:
application:
name: Spring Boot Excel API
datasource:
driverClassName: org.mariadb.jdbc.Driver
url: jdbc:mariadb://localhost:3306/SOC_Dashboard
username: admin
password: password
timeBetweenEvictionRunsMillis: 1000
testWhileIdle: true
validationQuery: SELECT 1
in which I configured the database connection for my project (I used JdbcTemplate to interact with my databse since now and I am replacing with Spring Data JPA).
I am not so into Spring Boot but it seems to me that exist 2 ways to set the configuration into my application.properties file: one is as done in my configuration (using something like a tree structure) and another one use a "flast" structure.
Searching online I only found this "flat" configuration for JPA:
spring.jpa.hibernate.ddl-auto=none
that is not working in my case. Putting it into my application.properties file I obtain a syntax error due to the fact that it is using the other tree style.
So I am trying to change my original file in this way:
spring:
application:
name: Spring Boot Excel API
datasource:
driverClassName: org.mariadb.jdbc.Driver
url: jdbc:mariadb://localhost:3306/SOC_Dashboard
username: admin
password: password
timeBetweenEvictionRunsMillis: 1000
testWhileIdle: true
validationQuery: SELECT 1
jpa:
hibernate:
ddl-auto: none
Is it the right way to proceed?
Another doubt is related to the ddl-auto configuration. My development is database driven. I design the DB tables and JPA entity have to map these tables. I don't want to create\modify tables starting from my entity. Is it the right configuration?