From 1d3c8a224c7c0455cd29a183a2f0e98624587481 Mon Sep 17 00:00:00 2001 From: Fouad Almalki Date: Wed, 5 Apr 2023 06:12:57 +0300 Subject: [PATCH] Backport support for Hibernate 6.2. 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. --- spring-data-jpa/pom.xml | 14 +++++++------- .../PostgresStoredProcedureIntegrationTests.java | 2 +- ...toredProcedureNullHandlingIntegrationTests.java | 6 +++--- .../src/test/resources/META-INF/persistence.xml | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/spring-data-jpa/pom.xml b/spring-data-jpa/pom.xml index ee5ed2dde..6a4562132 100644 --- a/spring-data-jpa/pom.xml +++ b/spring-data-jpa/pom.xml @@ -137,13 +137,6 @@ - - org.eclipse.persistence - org.eclipse.persistence.jpa - ${eclipselink} - true - - ${hibernate.groupId}.orm hibernate-core @@ -177,6 +170,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 c812307f5..f0259324c 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 @@ -201,7 +201,7 @@ public 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"); } 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 6f494ef69..d1b51afac 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 @@ public 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 @@ public 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 - +