|
|
|
|
@ -24,10 +24,12 @@ import org.springframework.aot.hint.RuntimeHints;
@@ -24,10 +24,12 @@ import org.springframework.aot.hint.RuntimeHints;
|
|
|
|
|
import org.springframework.aot.hint.RuntimeHintsRegistrar; |
|
|
|
|
import org.springframework.aot.hint.TypeReference; |
|
|
|
|
import org.springframework.data.mongodb.aot.MongoAotPredicates; |
|
|
|
|
import org.springframework.data.mongodb.repository.support.CrudMethodMetadata; |
|
|
|
|
import org.springframework.data.mongodb.repository.support.QuerydslMongoPredicateExecutor; |
|
|
|
|
import org.springframework.data.mongodb.repository.support.ReactiveQuerydslMongoPredicateExecutor; |
|
|
|
|
import org.springframework.data.querydsl.QuerydslUtils; |
|
|
|
|
import org.springframework.lang.Nullable; |
|
|
|
|
import org.springframework.util.ClassUtils; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author Christoph Strobl |
|
|
|
|
@ -43,6 +45,15 @@ class RepositoryRuntimeHints implements RuntimeHintsRegistrar {
@@ -43,6 +45,15 @@ class RepositoryRuntimeHints implements RuntimeHintsRegistrar {
|
|
|
|
|
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, |
|
|
|
|
MemberCategory.INVOKE_PUBLIC_METHODS)); |
|
|
|
|
|
|
|
|
|
if (isAopPresent(classLoader)) { |
|
|
|
|
|
|
|
|
|
// required for pushing ReadPreference,... into the default repository implementation
|
|
|
|
|
hints.proxies().registerJdkProxy(CrudMethodMetadata.class, //
|
|
|
|
|
org.springframework.aop.SpringProxy.class, //
|
|
|
|
|
org.springframework.aop.framework.Advised.class, //
|
|
|
|
|
org.springframework.core.DecoratingProxy.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (isReactorPresent()) { |
|
|
|
|
|
|
|
|
|
hints.reflection().registerTypes( |
|
|
|
|
@ -77,4 +88,8 @@ class RepositoryRuntimeHints implements RuntimeHintsRegistrar {
@@ -77,4 +88,8 @@ class RepositoryRuntimeHints implements RuntimeHintsRegistrar {
|
|
|
|
|
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static boolean isAopPresent(@Nullable ClassLoader classLoader) { |
|
|
|
|
return ClassUtils.isPresent("org.springframework.aop.Pointcut", classLoader); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|