From 0754fecd73679b928f277a1a1eb9172e4fbdbe43 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Wed, 19 Oct 2022 14:49:59 +0200 Subject: [PATCH] Add missing reflection hint for `QuerydslJpaPredicateExecutor`. Closes: #2673 Original pull request: #2674 --- .../data/jpa/repository/aot/JpaRuntimeHints.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/aot/JpaRuntimeHints.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/aot/JpaRuntimeHints.java index 0f4a4a768..c06e6f1b5 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/aot/JpaRuntimeHints.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/aot/JpaRuntimeHints.java @@ -24,7 +24,10 @@ import org.springframework.aot.hint.TypeReference; import org.springframework.data.jpa.domain.support.AuditingBeanFactoryPostProcessor; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.jpa.repository.support.QuerydslJpaPredicateExecutor; import org.springframework.data.jpa.repository.support.SimpleJpaRepository; +import org.springframework.data.querydsl.QuerydslPredicateExecutor; +import org.springframework.data.querydsl.QuerydslUtils; import org.springframework.lang.Nullable; import org.springframework.util.ClassUtils; @@ -62,5 +65,12 @@ class JpaRuntimeHints implements RuntimeHintsRegistrar { // needs to present for evaluating default attribute values in JpaQueryMethod hints.reflection().registerType(Query.class, hint -> hint.withMembers(MemberCategory.INVOKE_PUBLIC_METHODS)); + + if(QuerydslUtils.QUERY_DSL_PRESENT) { + + hints.reflection().registerType(QuerydslJpaPredicateExecutor.class, + hint -> hint.withMembers(MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS) + .onReachableType(QuerydslPredicateExecutor.class)); + } } }