From d3e088f5b93f49c98b0bf1864294e803b086cc17 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Mon, 2 Jun 2025 10:29:00 +0200 Subject: [PATCH] Add missing reflection hint for DefaultQueryEnhancerSelector. Closes: #3905 --- .../data/jpa/repository/aot/JpaRuntimeHints.java | 6 ++++++ 1 file changed, 6 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 3b00237d2..b7b7b15cc 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 @@ -34,6 +34,7 @@ import org.springframework.data.jpa.domain.support.AuditingBeanFactoryPostProces import org.springframework.data.jpa.domain.support.AuditingEntityListener; import org.springframework.data.jpa.repository.EntityGraph; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.jpa.repository.query.QueryEnhancerSelector.DefaultQueryEnhancerSelector; import org.springframework.data.jpa.repository.support.QuerydslJpaPredicateExecutor; import org.springframework.data.jpa.repository.support.SimpleJpaRepository; import org.springframework.data.querydsl.QuerydslPredicateExecutor; @@ -69,6 +70,11 @@ class JpaRuntimeHints implements RuntimeHintsRegistrar { MemberCategory.INVOKE_DECLARED_METHODS)); } + // via JpaRepositoryFactoryBean creating the bean if not defined + hints.reflection().registerType(TypeReference.of(DefaultQueryEnhancerSelector.class), + hint -> hint.withMembers(MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, + MemberCategory.INVOKE_PUBLIC_METHODS)); + hints.reflection().registerType(TypeReference.of(SimpleJpaRepository.class), hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS));