Migrate hint registration to shortcuts
Migrate code to make use of the `MemberCategory` and `FieldMode` shortcuts. See gh-29011
This commit is contained in:
@@ -85,8 +85,7 @@ class TransactionBeanRegistrationAotProcessor implements BeanRegistrationAotProc
|
||||
return;
|
||||
}
|
||||
for (Class<?> proxyInterface : proxyInterfaces) {
|
||||
runtimeHints.reflection().registerType(proxyInterface,
|
||||
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_METHODS));
|
||||
runtimeHints.reflection().registerType(proxyInterface, MemberCategory.INVOKE_DECLARED_METHODS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.springframework.transaction.annotation;
|
||||
import org.springframework.aot.hint.MemberCategory;
|
||||
import org.springframework.aot.hint.RuntimeHints;
|
||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||
import org.springframework.aot.hint.TypeHint;
|
||||
import org.springframework.aot.hint.TypeReference;
|
||||
import org.springframework.aot.hint.support.RuntimeHintsUtils;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
@@ -37,7 +38,8 @@ class TransactionRuntimeHints implements RuntimeHintsRegistrar {
|
||||
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
||||
RuntimeHintsUtils.registerSynthesizedAnnotation(hints, Transactional.class);
|
||||
hints.reflection().registerTypes(TypeReference.listOf(
|
||||
Isolation.class, Propagation.class, TransactionDefinition.class),
|
||||
builder -> builder.withMembers(MemberCategory.DECLARED_FIELDS));
|
||||
Isolation.class, Propagation.class, TransactionDefinition.class),
|
||||
TypeHint.builtWith(MemberCategory.DECLARED_FIELDS));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user