Skip to content

Commit b18cd62

Browse files
Eng-Fouadgregturn
authored andcommitted
Upgrade to 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.
1 parent f91168d commit b18cd62

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

spring-data-jpa/pom.xml

+7-7
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,6 @@
137137

138138
<!-- Persistence providers -->
139139

140-
<dependency>
141-
<groupId>org.eclipse.persistence</groupId>
142-
<artifactId>org.eclipse.persistence.jpa</artifactId>
143-
<version>${eclipselink}</version>
144-
<optional>true</optional>
145-
</dependency>
146-
147140
<dependency>
148141
<groupId>${hibernate.groupId}.orm</groupId>
149142
<artifactId>hibernate-core</artifactId>
@@ -177,6 +170,13 @@
177170
<version>${jakarta-annotation-api}</version>
178171
</dependency>
179172

173+
<dependency>
174+
<groupId>org.eclipse.persistence</groupId>
175+
<artifactId>org.eclipse.persistence.jpa</artifactId>
176+
<version>${eclipselink}</version>
177+
<optional>true</optional>
178+
</dependency>
179+
180180
<!-- QueryDsl -->
181181
<dependency>
182182
<groupId>com.querydsl</groupId>

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/procedures/PostgresStoredProcedureIntegrationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static class Config {
201201
@Bean(initMethod = "start", destroyMethod = "stop")
202202
public PostgreSQLContainer<?> container() {
203203

204-
return new PostgreSQLContainer<>("postgres:9.6.12") //
204+
return new PostgreSQLContainer<>("postgres:10.21") //
205205
.withUsername("postgres");
206206
}
207207

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/procedures/PostgresStoredProcedureNullHandlingIntegrationTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
import javax.sql.DataSource;
3333

34-
import org.hibernate.dialect.PostgreSQL91Dialect;
34+
import org.hibernate.dialect.PostgreSQLDialect;
3535
import org.junit.jupiter.api.Test;
3636
import org.junit.jupiter.api.extension.ExtendWith;
3737
import org.postgresql.ds.PGSimpleDataSource;
@@ -109,7 +109,7 @@ static class Config {
109109
@Bean(initMethod = "start", destroyMethod = "stop")
110110
public PostgreSQLContainer<?> container() {
111111

112-
return new PostgreSQLContainer<>("postgres:9.6.12") //
112+
return new PostgreSQLContainer<>("postgres:10.21") //
113113
.withUsername("postgres");
114114
}
115115

@@ -135,7 +135,7 @@ public AbstractEntityManagerFactoryBean entityManagerFactory(DataSource dataSour
135135

136136
Properties properties = new Properties();
137137
properties.setProperty("hibernate.hbm2ddl.auto", "create");
138-
properties.setProperty("hibernate.dialect", PostgreSQL91Dialect.class.getCanonicalName());
138+
properties.setProperty("hibernate.dialect", PostgreSQLDialect.class.getCanonicalName());
139139
properties.setProperty("hibernate.proc.param_null_passing", "true");
140140
properties.setProperty("hibernate.globally_quoted_identifiers", "true");
141141
properties.setProperty("hibernate.globally_quoted_identifiers_skip_column_definitions", "true");

spring-data-jpa/src/test/resources/META-INF/persistence.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
<class>org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformationIntegrationTests$ExampleEntityWithUUIDId</class>
178178
<exclude-unlisted-classes>true</exclude-unlisted-classes>
179179
<properties>
180-
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL91Dialect" />
180+
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
181181
</properties>
182182
</persistence-unit>
183183
<persistence-unit name="metadata-id-handling-el">
@@ -195,7 +195,7 @@
195195
<class>org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformationIntegrationTests$ExampleEntityWithUUIDId</class>
196196
<exclude-unlisted-classes>true</exclude-unlisted-classes>
197197
<properties>
198-
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL91Dialect" />
198+
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
199199
</properties>
200200
</persistence-unit>
201201

0 commit comments

Comments
 (0)