1
resposta

MySQL

Caso alguém também queira utilizar o mysql para o curso aí está as configurações:

persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.2"
    xmlns="http://xmlns.jcp.org/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd">


        <persistence-unit name="loja" transaction-type="RESOURCE_LOCAL" >

            <properties>

                <property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/>
                <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/loja_virtual?useTimezone=true&amp;serverTimezone=UTC"/>
                <property name="javax.persistence.jdbc.user" value="root"/>
                <property name="javax.persistence.jdbc.password" value="root"/>


                <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL8Dialect" />
                <property name="hibernate.show_sql" value="true" />
                <property name="hibernate.hbm2ddl.auto" value="update" />
                <property name="hibernate.connection.autocommit" value="true"/>


            </properties>

        </persistence-unit>



</persistence>

Depêndencias:

<dependencies>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>5.4.27.Final</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.22</version>
        </dependency>


    </dependencies>
1 resposta

Obrigado por compartilhar Antony :)