Files
spring-boot-rest/persistence-modules/hibernate-jpa/src/main/resources/META-INF/persistence.xml
timis1 101fc1b424 JAVA-18167 Upgrade persistence-modules to JDK 11 (#13714)
* JAVA-18167 Upgrade persistence-modules to JDK 11 (activejdbc and core-java-persistence)

* JAVA-16167 Update pom.xml to include just the updated modules

* JAVA-18167 Added vaadin because it looks that I removed

* JAVA-18167 Migration deltaspike

* JAVA-18167 Migration hbase module

* JAVA-18167 Migration hibernate-mapping-2

* JAVA-18167 Migration hibernate-exceptions

* JAVA-18167 Migration hibernate-jpa module

* JAVA-18167 Migration hibernate-jpa change the name of User entity

* JAVA-18167 Overwriting the version of slf4j and logback for hibernate-jpa

* JAVA-18167 Migrate deltaspike back to jdk8

* JAVA-18167 Remove some modules that was added elsewhere

* Revert "JAVA-18167 Migration deltaspike"

This reverts commit 874b4ba2

* JAVA-18167 Comment failed module (it will be migrated later)

---------

Co-authored-by: timis1 <noreplay@yahoo.com>
2023-04-07 07:23:12 +05:30

142 lines
9.6 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="com.baeldung.movie_catalog">
<description>Hibernate EntityManager Demo</description>
<class>com.baeldung.hibernate.pojo.Movie</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="jakarta.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="jakarta.persistence.jdbc.url" value="jdbc:mysql://127.0.0.1:3306/moviecatalog"/>
<property name="jakarta.persistence.jdbc.user" value="root"/>
<property name="jakarta.persistence.jdbc.password" value="root"/>
<property name="hibernate.id.db_structure_naming_strategy" value="legacy" />
</properties>
</persistence-unit>
<!-- Persistence unit for H2 -->
<persistence-unit name="com.baeldung.hibernate.entitymanager.game_player_h2">
<description>EntityManager getReference persistence unit</description>
<class>com.baeldung.hibernate.entitymanager.getreference.Game</class>
<class>com.baeldung.hibernate.entitymanager.getreference.Player</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<!-- even if we set exclude-unlisted-classes=true, strangely it's not enough to exclude defined hbm files in hibernate.cfg.xml.
So, some entities out of the scope unwillingly managed by our persistence unit. In order to prevent this, we disable autodetection
of the hbm files completely. When we set this property, hibernate ignores the exclude-unlisted-classes property. -->
<property name="hibernate.archive.autodetection" value=""/>
<property name="hibernate.jpa.compliance.proxy" value="false"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.generate_statistics" value="false"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="jakarta.persistence.jdbc.driver" value="org.h2.Driver"/>
<property name="jakarta.persistence.jdbc.url" value="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1"/>
<property name="jakarta.persistence.jdbc.user" value="sa"/>
<property name="jakarta.persistence.jdbc.password" value=""/>
<property name="hibernate.id.db_structure_naming_strategy" value="legacy" />
<!-- ensure backward compatibility -->
<property name="hibernate.type.preferred_duration_jdbc_type" value="BIGINT" />
<property name="hibernate.type.preferred_instant_jdbc_type" value="TIMESTAMP" />
</properties>
</persistence-unit>
<!-- Persistence unit for MySQL -->
<persistence-unit name="com.baeldung.hibernate.entitymanager.game_player_mysql">
<description>EntityManager getReference persistence unit</description>
<class>com.baeldung.hibernate.entitymanager.getreference.Game</class>
<class>com.baeldung.hibernate.entitymanager.getreference.Player</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<!-- even if we set exclude-unlisted-classes=true, strangely it's not enough to exclude defined hbm files in hibernate.cfg.xml.
So, some entities out of the scope unwillingly managed by our persistence unit. In order to prevent this, we disable autodetection
of the hbm files completely. When we set this property, hibernate ignores the exclude-unlisted-classes property. -->
<property name="hibernate.archive.autodetection" value=""/>
<property name="hibernate.jpa.compliance.proxy" value="false"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.generate_statistics" value="false"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="jakarta.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="jakarta.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/baeldung"/>
<property name="jakarta.persistence.jdbc.user" value="root"/>
<property name="jakarta.persistence.jdbc.password" value="password"/>
<property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create"/>
<property name="jakarta.persistence.schema-generation.create-script-source" value="/META-INF/create-db.sql"/>
<property name="jakarta.persistence.schema-generation.drop-script-source" value="/META-INF/drop-db.sql"/>
<property name="jakarta.persistence.sql-load-script-source" value="/META-INF/data.sql"/>
<property name="hibernate.id.db_structure_naming_strategy" value="legacy" />
<!-- ensure backward compatibility -->
<property name="hibernate.type.preferred_duration_jdbc_type" value="BIGINT" />
<property name="hibernate.type.preferred_instant_jdbc_type" value="TIMESTAMP" />
</properties>
</persistence-unit>
<!-- Persistence unit for PostgreSQL -->
<persistence-unit name="com.baeldung.hibernate.entitymanager.game_player_postgresql">
<description>EntityManager getReference persistence unit</description>
<class>com.baeldung.hibernate.entitymanager.getreference.Game</class>
<class>com.baeldung.hibernate.entitymanager.getreference.Player</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<!-- even if we set exclude-unlisted-classes=true, strangely it's not enough to exclude defined hbm files in hibernate.cfg.xml.
So, some entities out of the scope unwillingly managed by our persistence unit. In order to prevent this, we disable autodetection
of the hbm files completely. When we set this property, hibernate ignores the exclude-unlisted-classes property. -->
<property name="hibernate.archive.autodetection" value=""/>
<property name="hibernate.jpa.compliance.proxy" value="false"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.generate_statistics" value="false"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="jakarta.persistence.jdbc.driver" value="org.postgresql.Driver"/>
<property name="jakarta.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/postgres"/>
<property name="jakarta.persistence.jdbc.user" value="postgres"/>
<property name="jakarta.persistence.jdbc.password" value=""/>
<property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create"/>
<property name="jakarta.persistence.schema-generation.create-script-source" value="/META-INF/create-db.sql"/>
<property name="jakarta.persistence.schema-generation.drop-script-source" value="/META-INF/drop-db.sql"/>
<property name="jakarta.persistence.sql-load-script-source" value="/META-INF/data.sql"/>
<property name="hibernate.id.db_structure_naming_strategy" value="legacy" />
<!-- ensure backward compatibility -->
<property name="hibernate.type.preferred_duration_jdbc_type" value="BIGINT" />
<property name="hibernate.type.preferred_instant_jdbc_type" value="TIMESTAMP" />
</properties>
</persistence-unit>
<persistence-unit name="com.baeldung.hibernate.serializable.h2_persistence_unit">
<description>EntityManager serializable persistence unit</description>
<class>com.baeldung.hibernate.serializable.Email</class>
<class>com.baeldung.hibernate.serializable.Account</class>
<class>com.baeldung.hibernate.serializable.User</class>
<class>com.baeldung.hibernate.serializable.UserId</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.generate_statistics" value="false"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="jakarta.persistence.jdbc.driver" value="org.h2.Driver"/>
<property name="jakarta.persistence.jdbc.url" value="jdbc:h2:mem:db2;DB_CLOSE_DELAY=-1"/>
<property name="jakarta.persistence.jdbc.user" value="sa"/>
<property name="jakarta.persistence.jdbc.password" value=""/>
<property name="hibernate.id.db_structure_naming_strategy" value="legacy" />
<!-- ensure backward compatibility -->
<property name="hibernate.type.preferred_duration_jdbc_type" value="BIGINT" />
<property name="hibernate.type.preferred_instant_jdbc_type" value="TIMESTAMP" />
<property name="hibernate.globally_quoted_identifiers" value="true"/>
</properties>
</persistence-unit>
</persistence>