Skip to content

Commit efd799c

Browse files
Eng-Fouadodrotbohm
authored andcommitted
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.
1 parent 0c90ff3 commit efd799c

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
<antlr>4.10.1</antlr> <!-- align with Hibernate's parser -->
3434
<eclipselink>3.0.3</eclipselink>
35-
<hibernate>6.1.4.Final</hibernate>
35+
<hibernate>6.2.0.Final</hibernate>
3636
<hsqldb>2.7.1</hsqldb>
3737
<jsqlparser>4.5</jsqlparser>
3838
<mysql-connector-java>8.0.31</mysql-connector-java>

spring-data-jpa/pom.xml

+7-7
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,6 @@
143143

144144
<!-- Persistence providers -->
145145

146-
<dependency>
147-
<groupId>org.eclipse.persistence</groupId>
148-
<artifactId>org.eclipse.persistence.jpa</artifactId>
149-
<version>${eclipselink}</version>
150-
<optional>true</optional>
151-
</dependency>
152-
153146
<dependency>
154147
<groupId>${hibernate.groupId}.orm</groupId>
155148
<artifactId>hibernate-core</artifactId>
@@ -183,6 +176,13 @@
183176
<version>${jakarta-annotation-api}</version>
184177
</dependency>
185178

179+
<dependency>
180+
<groupId>org.eclipse.persistence</groupId>
181+
<artifactId>org.eclipse.persistence.jpa</artifactId>
182+
<version>${eclipselink}</version>
183+
<optional>true</optional>
184+
</dependency>
185+
186186
<!-- QueryDsl -->
187187
<dependency>
188188
<groupId>com.querydsl</groupId>

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
import javax.sql.DataSource;
3737

38-
import org.hibernate.dialect.PostgreSQL91Dialect;
38+
import org.hibernate.dialect.PostgreSQLDialect;
3939
import org.junit.jupiter.api.Test;
4040
import org.junit.jupiter.api.extension.ExtendWith;
4141
import org.postgresql.ds.PGSimpleDataSource;
@@ -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

@@ -226,7 +226,7 @@ public AbstractEntityManagerFactoryBean entityManagerFactory(DataSource dataSour
226226

227227
Properties properties = new Properties();
228228
properties.setProperty("hibernate.hbm2ddl.auto", "create");
229-
properties.setProperty("hibernate.dialect", PostgreSQL91Dialect.class.getCanonicalName());
229+
properties.setProperty("hibernate.dialect", PostgreSQLDialect.class.getCanonicalName());
230230
factoryBean.setJpaProperties(properties);
231231

232232
return factoryBean;

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)