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.
This commit is contained in:
Fouad Almalki
2023-04-05 06:12:57 +03:00
committed by Oliver Drotbohm
parent 0c90ff3759
commit efd799c4de
5 changed files with 16 additions and 16 deletions

View File

@@ -32,7 +32,7 @@
<antlr>4.10.1</antlr> <!-- align with Hibernate's parser -->
<eclipselink>3.0.3</eclipselink>
<hibernate>6.1.4.Final</hibernate>
<hibernate>6.2.0.Final</hibernate>
<hsqldb>2.7.1</hsqldb>
<jsqlparser>4.5</jsqlparser>
<mysql-connector-java>8.0.31</mysql-connector-java>

View File

@@ -143,13 +143,6 @@
<!-- Persistence providers -->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId>
<version>${eclipselink}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${hibernate.groupId}.orm</groupId>
<artifactId>hibernate-core</artifactId>
@@ -183,6 +176,13 @@
<version>${jakarta-annotation-api}</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId>
<version>${eclipselink}</version>
<optional>true</optional>
</dependency>
<!-- QueryDsl -->
<dependency>
<groupId>com.querydsl</groupId>

View File

@@ -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;

View File

@@ -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");

View File

@@ -177,7 +177,7 @@
<class>org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformationIntegrationTests$ExampleEntityWithUUIDId</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL91Dialect" />
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
</properties>
</persistence-unit>
<persistence-unit name="metadata-id-handling-el">
@@ -195,7 +195,7 @@
<class>org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformationIntegrationTests$ExampleEntityWithUUIDId</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL91Dialect" />
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
</properties>
</persistence-unit>