From efd799c4de3bb357e36878ab515875b91cc6e74a Mon Sep 17 00:00:00 2001 From: Fouad Almalki Date: Wed, 5 Apr 2023 06:12:57 +0300 Subject: [PATCH] Upgrade to Hibernate 6.2. Upgrade Postgres to 10 for stored procedure related tests. Move off deprecated Hibernate Postgres 9.1 dialect. Switch order of persistence provider dependencies. Hibernate 6.2 needs to be declared before Eclipselink as the latter pulls in JPA 3.0 but the former now strongly requires 3.1. Related tickets: #2899. --- pom.xml | 2 +- spring-data-jpa/pom.xml | 14 +++++++------- .../PostgresStoredProcedureIntegrationTests.java | 6 +++--- ...toredProcedureNullHandlingIntegrationTests.java | 6 +++--- .../src/test/resources/META-INF/persistence.xml | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index b724b3a96..cddfd1c0d 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 4.10.1 3.0.3 - 6.1.4.Final + 6.2.0.Final 2.7.1 4.5 8.0.31 diff --git a/spring-data-jpa/pom.xml b/spring-data-jpa/pom.xml index c8fcf610a..ea9125d02 100644 --- a/spring-data-jpa/pom.xml +++ b/spring-data-jpa/pom.xml @@ -143,13 +143,6 @@ - - org.eclipse.persistence - org.eclipse.persistence.jpa - ${eclipselink} - true - - ${hibernate.groupId}.orm hibernate-core @@ -183,6 +176,13 @@ ${jakarta-annotation-api} + + org.eclipse.persistence + org.eclipse.persistence.jpa + ${eclipselink} + true + + com.querydsl diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/procedures/PostgresStoredProcedureIntegrationTests.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/procedures/PostgresStoredProcedureIntegrationTests.java index 48907cbcc..88e560b12 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/procedures/PostgresStoredProcedureIntegrationTests.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/procedures/PostgresStoredProcedureIntegrationTests.java @@ -35,7 +35,7 @@ import java.util.Properties; import javax.sql.DataSource; -import org.hibernate.dialect.PostgreSQL91Dialect; +import org.hibernate.dialect.PostgreSQLDialect; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.postgresql.ds.PGSimpleDataSource; @@ -201,7 +201,7 @@ class PostgresStoredProcedureIntegrationTests { @Bean(initMethod = "start", destroyMethod = "stop") public PostgreSQLContainer container() { - return new PostgreSQLContainer<>("postgres:9.6.12") // + return new PostgreSQLContainer<>("postgres:10.21") // .withUsername("postgres"); } @@ -226,7 +226,7 @@ class PostgresStoredProcedureIntegrationTests { Properties properties = new Properties(); properties.setProperty("hibernate.hbm2ddl.auto", "create"); - properties.setProperty("hibernate.dialect", PostgreSQL91Dialect.class.getCanonicalName()); + properties.setProperty("hibernate.dialect", PostgreSQLDialect.class.getCanonicalName()); factoryBean.setJpaProperties(properties); return factoryBean; diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/procedures/PostgresStoredProcedureNullHandlingIntegrationTests.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/procedures/PostgresStoredProcedureNullHandlingIntegrationTests.java index 2d508020d..10aa204f3 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/procedures/PostgresStoredProcedureNullHandlingIntegrationTests.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/procedures/PostgresStoredProcedureNullHandlingIntegrationTests.java @@ -31,7 +31,7 @@ import java.util.UUID; import javax.sql.DataSource; -import org.hibernate.dialect.PostgreSQL91Dialect; +import org.hibernate.dialect.PostgreSQLDialect; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.postgresql.ds.PGSimpleDataSource; @@ -109,7 +109,7 @@ class PostgresStoredProcedureNullHandlingIntegrationTests { @Bean(initMethod = "start", destroyMethod = "stop") public PostgreSQLContainer container() { - return new PostgreSQLContainer<>("postgres:9.6.12") // + return new PostgreSQLContainer<>("postgres:10.21") // .withUsername("postgres"); } @@ -135,7 +135,7 @@ class PostgresStoredProcedureNullHandlingIntegrationTests { Properties properties = new Properties(); properties.setProperty("hibernate.hbm2ddl.auto", "create"); - properties.setProperty("hibernate.dialect", PostgreSQL91Dialect.class.getCanonicalName()); + properties.setProperty("hibernate.dialect", PostgreSQLDialect.class.getCanonicalName()); properties.setProperty("hibernate.proc.param_null_passing", "true"); properties.setProperty("hibernate.globally_quoted_identifiers", "true"); properties.setProperty("hibernate.globally_quoted_identifiers_skip_column_definitions", "true"); diff --git a/spring-data-jpa/src/test/resources/META-INF/persistence.xml b/spring-data-jpa/src/test/resources/META-INF/persistence.xml index 280312885..c5e0e90b0 100644 --- a/spring-data-jpa/src/test/resources/META-INF/persistence.xml +++ b/spring-data-jpa/src/test/resources/META-INF/persistence.xml @@ -177,7 +177,7 @@ org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformationIntegrationTests$ExampleEntityWithUUIDId true - + @@ -195,7 +195,7 @@ org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformationIntegrationTests$ExampleEntityWithUUIDId true - +