Skip to content

Commit 443c2ba

Browse files
Add missing reflection hint for NamedEntityGraph when EntityGraph is present.
Closes: #2681 See also: spring-projects/spring-aot-smoke-tests#135
1 parent f8da86d commit 443c2ba

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package org.springframework.data.jpa.repository.aot;
1717

18+
import jakarta.persistence.NamedEntityGraph;
19+
1820
import java.util.Arrays;
1921

2022
import org.springframework.aot.hint.MemberCategory;
@@ -23,6 +25,7 @@
2325
import org.springframework.aot.hint.TypeReference;
2426
import org.springframework.data.jpa.domain.support.AuditingBeanFactoryPostProcessor;
2527
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
28+
import org.springframework.data.jpa.repository.EntityGraph;
2629
import org.springframework.data.jpa.repository.Query;
2730
import org.springframework.data.jpa.repository.support.QuerydslJpaPredicateExecutor;
2831
import org.springframework.data.jpa.repository.support.SimpleJpaRepository;
@@ -72,5 +75,8 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
7275
hint -> hint.withMembers(MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS)
7376
.onReachableType(QuerydslPredicateExecutor.class));
7477
}
78+
79+
hints.reflection().registerType(NamedEntityGraph.class,
80+
hint -> hint.onReachableType(EntityGraph.class).withMembers(MemberCategory.INVOKE_PUBLIC_METHODS));
7581
}
7682
}

0 commit comments

Comments
 (0)