0
I am currently trying to configure my application with spring-boot to generate tables automatically but still do not know how, someone can help?
0
I am currently trying to configure my application with spring-boot to generate tables automatically but still do not know how, someone can help?
1
You must create the file application.properties
and configure your database on it. Example:
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.url=jdbc\:mysql\://localhost/meu-banco
spring.jpa.hibernate.ddl-auto=update
When the parameter spring.jpa.hibernate.ddl-auto
is configured as update
, When starting the application, Hibernate will check that tables have already been created, if they have not yet been created, it will automatically create them.
Another detail, is that to create the tables, their entities should be annotated with @Entity
Browser other questions tagged hibernate jpa spring-boot
You are not signed in. Login or sign up in order to post.
I think your question should be more specific. I recommend this tutorial here: https://spring.io/guides/gs/accessing-data-mysql/
– nbkhope