Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

ao executar o "run as" aplicação não está criando a tabela

Application.properities está idêntico ao do professor: (a porta que utilizei foi a 3307)

spring.datasource.url=jdbc:mariadb://127.0.0.1:3307/alura spring.datasource.username=root spring.datasource.password=root spring.datasource.testWhileIdle=true spring.datasource.validationQuery=SELECT 1 spring.datasource.driver-class-name=org.mariadb.jdbc.Driver spring.jpa.show-sql=false spring.jpa.hibernate.ddl-auto=update spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImproveNamingStrategy spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDBDialect

. __ _ __ _ _ /\ / _'_ _ _ _()_ _ __ _ \ \ \ ( ( )___ | ' | '| | ' / ` | \ \ \ \/ ___)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||_| |_, | / / / / =========||==============|__/=//// :: Spring Boot :: (v2.6.7)

2022-04-26 22:46:18.484 INFO 20500 --- [ main] b.c.a.spring.data.SpringDataApplication : Starting SpringDataApplication using Java 18 on NTLTJNBSIDPS01 with PID 20500 (C:\spring-data\target\classes started by Usuário in C:\spring-data) 2022-04-26 22:46:18.488 INFO 20500 --- [ main] b.c.a.spring.data.SpringDataApplication : No active profile set, falling back to 1 default profile: "default" 2022-04-26 22:46:18.977 INFO 20500 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2022-04-26 22:46:18.994 INFO 20500 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 5 ms. Found 0 JPA repository interfaces. 2022-04-26 22:46:19.534 INFO 20500 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2022-04-26 22:46:19.591 INFO 20500 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.8.Final 2022-04-26 22:46:19.804 INFO 20500 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final} 2022-04-26 22:46:19.974 INFO 20500 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2022-04-26 22:46:20.045 INFO 20500 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2022-04-26 22:46:20.060 INFO 20500 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MariaDBDialect 2022-04-26 22:46:20.613 INFO 20500 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2022-04-26 22:46:20.619 INFO 20500 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2022-04-26 22:46:20.728 INFO 20500 --- [ main] b.c.a.spring.data.SpringDataApplication : Started SpringDataApplication in 2.681 seconds (JVM running for 3.05) 2022-04-26 22:46:20.737 INFO 20500 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2022-04-26 22:46:20.739 INFO 20500 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2022-04-26 22:46:20.745 INFO 20500 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.

2 respostas
solução!

Olá @Aarão,

Tente trocar isso spring.jpa.hibernate.ddl-auto=update

por isso spring.jpa.hibernate.ddl-auto=create

verifique se o usuário de banco que está sendo utilizado tem permissão para criar tabelas no banco.

Obrigado pela ajuda hvivox, aparentemente o problema continuava, pois, a mensagem "Shutdown completed" permanece, mas, a tabela foi criada no banco.