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));