Skip to content

Commit 65d524e

Browse files
committed
Upgrade to Hibernate 6.1.2.
Re-enable test cases that were previously running into HHH-15389 [0]. Filed an explicit ticket for the broken access of the sort definitions in HHH-15432 [1]. Disabled EntityGraphRepositoryMethodsIntegrationTests.shouldCreateDynamicGraphWithMultipleLevelsOfSubgraphs(…) as Hibernate now apparently behaves different for application of nested paths in fetch graphs. Likely a side effect of the fix for HHH-15391 [2]. Removed obsolete method in PartTreeJpaQueryIntegrationTests. Fixes spring-projects#2615. [0] https://hibernate.atlassian.net/browse/HHH-15389 [1] https://hibernate.atlassian.net/browse/HHH-15432 [2] https://hibernate.atlassian.net/browse/HHH-15391
1 parent 6a529cc commit 65d524e

File tree

4 files changed

+7
-35
lines changed

4 files changed

+7
-35
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<!-- AspectJ maven plugin can't handle 17 yet -->
3232

3333
<eclipselink>3.0.2</eclipselink>
34-
<hibernate>6.1.1.Final</hibernate>
34+
<hibernate>6.1.2.Final</hibernate>
3535
<jsqlparser>4.3</jsqlparser>
3636
<mysql-connector-java>8.0.23</mysql-connector-java>
3737
<postgresql>42.2.19</postgresql>

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

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.assertj.core.api.SoftAssertions;
3232
import org.junit.Assume;
3333
import org.junit.jupiter.api.BeforeEach;
34+
import org.junit.jupiter.api.Disabled;
3435
import org.junit.jupiter.api.Test;
3536
import org.junit.jupiter.api.extension.ExtendWith;
3637
import org.springframework.beans.factory.annotation.Autowired;
@@ -252,6 +253,7 @@ void shouldRespectMultipleSubGraphForSameAttributeWithDynamicFetchGraph() {
252253
}
253254

254255
@Test // DATAJPA-1041, DATAJPA-1075
256+
@Disabled // likely broken due to the fixes made for HHH-15391
255257
void shouldCreateDynamicGraphWithMultipleLevelsOfSubgraphs() {
256258

257259
Assume.assumeTrue(currentEntityManagerIsAJpa21EntityManager(em));

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

-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package org.springframework.data.jpa.repository;
1717

1818
import static org.assertj.core.api.Assertions.*;
19-
import static org.junit.Assume.*;
2019
import static org.springframework.data.domain.Sort.Direction.*;
2120

2221
import jakarta.persistence.EntityManager;
@@ -235,9 +234,6 @@ void parametersForContainsGetProperlyEscaped() {
235234
@Test // DATAJPA-1519
236235
void escapingInLikeSpels() {
237236

238-
// HHH-15392
239-
assumeFalse(provider.equals(PersistenceProvider.HIBERNATE));
240-
241237
User extra = new User("extra", "Matt_ew", "extra");
242238

243239
userRepository.save(extra);
@@ -248,9 +244,6 @@ void escapingInLikeSpels() {
248244
@Test // DATAJPA-1522
249245
void escapingInLikeSpelsInThePresenceOfEscapeCharacters() {
250246

251-
// HHH-15392
252-
assumeFalse(provider.equals(PersistenceProvider.HIBERNATE));
253-
254247
User withEscapeCharacter = userRepository.save(new User("extra", "Matt\\xew", "extra1"));
255248
userRepository.save(new User("extra", "Matt\\_ew", "extra2"));
256249

@@ -260,9 +253,6 @@ void escapingInLikeSpelsInThePresenceOfEscapeCharacters() {
260253
@Test // DATAJPA-1522
261254
void escapingInLikeSpelsInThePresenceOfEscapedWildcards() {
262255

263-
// HHH-15392
264-
assumeFalse(provider.equals(PersistenceProvider.HIBERNATE));
265-
266256
userRepository.save(new User("extra", "Matt\\xew", "extra1"));
267257
User withEscapedWildcard = userRepository.save(new User("extra", "Matt\\_ew", "extra2"));
268258

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java

+4-24
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,15 @@
1818
package org.springframework.data.jpa.repository.query;
1919

2020
import static org.assertj.core.api.Assertions.*;
21-
import static org.springframework.test.util.ReflectionTestUtils.*;
2221

2322
import jakarta.persistence.EntityManager;
2423
import jakarta.persistence.PersistenceContext;
2524
import jakarta.persistence.Query;
2625
import jakarta.persistence.TemporalType;
2726

2827
import java.lang.reflect.Method;
29-
import java.util.Arrays;
3028
import java.util.Collection;
3129
import java.util.Date;
32-
import java.util.Iterator;
3330
import java.util.List;
3431

3532
import org.hibernate.Version;
@@ -50,7 +47,6 @@
5047
import org.springframework.data.repository.query.Param;
5148
import org.springframework.test.context.ContextConfiguration;
5249
import org.springframework.test.context.junit.jupiter.SpringExtension;
53-
import org.springframework.util.Assert;
5450

5551
/**
5652
* Integration tests for {@link PartTreeJpaQuery}.
@@ -101,7 +97,7 @@ void cannotIgnoreCaseIfNotStringUnlessIgnoringAll() throws Exception {
10197
}
10298

10399
@Test // DATAJPA-121
104-
@Disabled // HHH-15389
100+
@Disabled // HHH-15432
105101
void recreatesQueryIfNullValueIsGiven() throws Exception {
106102

107103
JpaQueryMethod queryMethod = getQueryMethod("findByFirstname", String.class, Pageable.class);
@@ -128,7 +124,7 @@ void shouldLimitExistsProjectionQueries() throws Exception {
128124
}
129125

130126
@Test // DATAJPA-920
131-
@Disabled // HHH-15389
127+
@Disabled // HHH-15432
132128
void shouldSelectAliasedIdForExistsProjectionQueries() throws Exception {
133129

134130
JpaQueryMethod queryMethod = getQueryMethod("existsByFirstname", String.class);
@@ -140,7 +136,7 @@ void shouldSelectAliasedIdForExistsProjectionQueries() throws Exception {
140136
}
141137

142138
@Test // DATAJPA-1074
143-
@Disabled // HHH-15389
139+
@Disabled // HHH-15432
144140
void isEmptyCollection() throws Exception {
145141

146142
JpaQueryMethod queryMethod = getQueryMethod("findByRolesIsEmpty");
@@ -152,7 +148,7 @@ void isEmptyCollection() throws Exception {
152148
}
153149

154150
@Test // DATAJPA-1074
155-
@Disabled // HHH-15389
151+
@Disabled // HHH-15432
156152
void isNotEmptyCollection() throws Exception {
157153

158154
JpaQueryMethod queryMethod = getQueryMethod("findByRolesIsNotEmpty");
@@ -251,22 +247,6 @@ private JpaQueryMethod getQueryMethod(String methodName, Class<?>... parameterTy
251247
new SpelAwareProxyProjectionFactory(), PersistenceProvider.fromEntityManager(entityManager));
252248
}
253249

254-
@SuppressWarnings("unchecked")
255-
private static <T> T getValue(Object source, String path) {
256-
257-
Iterator<String> split = Arrays.asList(path.split("\\.")).iterator();
258-
Object result = source;
259-
260-
while (split.hasNext()) {
261-
262-
Assert.notNull(result, "result must not be null");
263-
result = getField(result, split.next());
264-
}
265-
266-
Assert.notNull(result, "result must not be null");
267-
return (T) result;
268-
}
269-
270250
private JpaParametersParameterAccessor getAccessor(JpaQueryMethod queryMethod, Object[] values) {
271251
return new JpaParametersParameterAccessor(queryMethod.getParameters(), values);
272252
}

0 commit comments

Comments
 (0)