segue classes e arquivos
classe TestesCriaTabelas.java
package br.com.allan.jpa.testes;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
public class TesteCriaTabelas {
public static void main(String[] args) {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("contas");
EntityManager createEntityManager = emf.createEntityManager();
emf.close();
}
}
arquivo persistence.xml
<persistence-unit name="contas">
<provider>org.hibernate.jpa.HibernatePersistence</provider>
<class>br.com.allan.jpa.modelo.Conta</class>
<properties>
<property name="javax.persistence.jdbc.driver"
value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.url"
value="jdbc:mysql://localhost/alura_jpa" />
<property name="javax.persistence.jdbc.user" value="root" />
<property name="javax.persistence.jdbc.password" value="" />
<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQL5InnoDBDialect" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="update" />
</properties>
</persistence-unit>
arquivo pom.xml
4.0.0
br.com.allan.jpa
projeto-jpa
0.0.1-SNAPSHOT
org.hibernate
hibernate-agroal
5.4.10.Final
pom
mysql
mysql-connector-java
8.0.18