Last active
August 13, 2022 22:24
-
-
Save JorisNienkemper/8c6f0967abf399f26b842a7d49a1332c to your computer and use it in GitHub Desktop.
persistence.xml jpa version 2.2 hibernate mysql8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<persistence 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" | |
version="2.2"> | |
<persistence-unit name="kcPersistenceUnit" transaction-type="RESOURCE_LOCAL"> | |
<description> | |
Persistence unit for the JPA tutorial of the Hibernate Getting Started Guide | |
</description> | |
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> | |
<class>com.ing.kc.domain.Cursist</class> | |
<class>com.ing.kc.domain.Cursus</class> | |
<properties> | |
<property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver" /> | |
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/cursistdb?serverTimezone=UTC" /> | |
<property name="javax.persistence.jdbc.user" value="username" /> | |
<property name="javax.persistence.jdbc.password" value="password" /> | |
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/> | |
<property name="javax.persistence.schema-generation.scripts.action" value="drop-and-create"/> | |
<property name="javax.persistence.schema-generation.scripts.create-target" value="sampleCreate.ddl"/> | |
<property name="javax.persistence.schema-generation.scripts.drop-target" value="sampleDrop.ddl"/> | |
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL8Dialect" /> | |
<property name="hibernate.show_sql" value="true" /> | |
<!--<property name="hibernate.hbm2ddl.auto" value="create" />--> | |
</properties> | |
</persistence-unit> | |
</persistence> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://xmlns.jcp.org/xml/ns/persistence_2_2.xsd" ----- (wrong)------
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd ----(right)----