Skip to content

Commit 1cad907

Browse files
Resolve deprecation warnings in JpaRuntimeHints.
See: #3905
1 parent d3e088f commit 1cad907

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/aot/JpaRuntimeHints.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
import java.util.Collections;
2222
import java.util.List;
2323

24-
import org.springframework.aot.hint.ExecutableMode;
25-
2624
import org.jspecify.annotations.Nullable;
25+
import org.springframework.aot.hint.ExecutableMode;
2726
import org.springframework.aot.hint.MemberCategory;
2827
import org.springframework.aot.hint.RuntimeHints;
2928
import org.springframework.aot.hint.RuntimeHintsRegistrar;
@@ -84,7 +83,7 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
8483
// make sure annotations on the fields are visible and allow reflection on protected methods
8584
hints.reflection().registerTypes(
8685
List.of(TypeReference.of(AbstractPersistable.class), TypeReference.of(AbstractAuditable.class)),
87-
hint -> hint.withMembers(MemberCategory.DECLARED_FIELDS, MemberCategory.INVOKE_DECLARED_METHODS));
86+
hint -> hint.withMembers(MemberCategory.ACCESS_DECLARED_FIELDS, MemberCategory.INVOKE_DECLARED_METHODS));
8887

8988
if (QuerydslUtils.QUERY_DSL_PRESENT) {
9089

@@ -94,9 +93,8 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
9493
}
9594

9695
// streaming results requires reflective access to jakarta.persistence.Query#getResultAsStream
97-
hints.reflection().registerType(jakarta.persistence.Query.class, MemberCategory.INTROSPECT_PUBLIC_METHODS);
98-
hints.reflection().registerType(jakarta.persistence.Query.class, hint ->
99-
hint.withMethod("getResultStream", Collections.emptyList(), ExecutableMode.INVOKE));
96+
hints.reflection().registerType(jakarta.persistence.Query.class,
97+
hint -> hint.withMethod("getResultStream", Collections.emptyList(), ExecutableMode.INVOKE));
10098

10199
hints.reflection().registerType(NamedEntityGraph.class,
102100
hint -> hint.onReachableType(EntityGraph.class).withMembers(MemberCategory.INVOKE_PUBLIC_METHODS));

0 commit comments

Comments
 (0)