Polishing.

Refine name and visibility of runtime hints registrars.

See #1279
see #1269
This commit is contained in:
Mark Paluch
2022-07-06 15:37:39 +02:00
parent 70eca3a2ca
commit b71e3b9697
6 changed files with 19 additions and 17 deletions

View File

@@ -28,21 +28,22 @@ import org.springframework.data.r2dbc.mapping.event.BeforeSaveCallback;
import org.springframework.data.r2dbc.repository.support.SimpleR2dbcRepository;
/**
* {@link RuntimeHintsRegistrar} for R2DBC.
*
* @author Christoph Strobl
* @since 3.0
*/
public class R2dbcRuntimeHints implements RuntimeHintsRegistrar {
class R2dbcRuntimeHintsRegistrar implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
hints.reflection().registerTypes(Arrays.asList(
TypeReference.of(SimpleR2dbcRepository.class),
TypeReference.of(AfterConvertCallback.class),
TypeReference.of(BeforeConvertCallback.class),
TypeReference.of(BeforeSaveCallback.class),
TypeReference.of(AfterSaveCallback.class)
),
hints.reflection()
.registerTypes(
Arrays.asList(TypeReference.of(SimpleR2dbcRepository.class), TypeReference.of(AfterConvertCallback.class),
TypeReference
.of(BeforeConvertCallback.class),
TypeReference.of(BeforeSaveCallback.class), TypeReference.of(AfterSaveCallback.class)),
hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS));
}
}

View File

@@ -208,12 +208,12 @@ public abstract class AbstractR2dbcConfiguration implements ApplicationContextAw
/**
* Creates a {@link org.springframework.data.r2dbc.convert.R2dbcConverter} using the configured
* {@link #r2dbcMappingContext(Optional, R2dbcCustomConversions)} R2dbcMappingContext}.
* {@link #r2dbcMappingContext(Optional, R2dbcCustomConversions, RelationalManagedTypes)} R2dbcMappingContext}.
*
* @param mappingContext the configured {@link R2dbcMappingContext}.
* @param r2dbcCustomConversions customized R2DBC conversions.
* @return must not be {@literal null}.
* @see #r2dbcMappingContext(Optional, R2dbcCustomConversions)
* @see #r2dbcMappingContext(Optional, R2dbcCustomConversions, RelationalManagedTypes)
* @see #getDialect(ConnectionFactory)
* @throws IllegalArgumentException if any of the {@literal mappingContext} is {@literal null}.
* @since 1.2
@@ -230,7 +230,7 @@ public abstract class AbstractR2dbcConfiguration implements ApplicationContextAw
/**
* Register custom {@link Converter}s in a {@link CustomConversions} object if required. These
* {@link CustomConversions} will be registered with the {@link BasicRelationalConverter} and
* {@link #r2dbcMappingContext(Optional, R2dbcCustomConversions)}. Returns an empty {@link R2dbcCustomConversions}
* {@link #r2dbcMappingContext(Optional, R2dbcCustomConversions, RelationalManagedTypes)}. Returns an empty {@link R2dbcCustomConversions}
* instance by default. Override {@link #getCustomConverters()} to supply custom converters.
*
* @return must not be {@literal null}.

View File

@@ -1,2 +1,2 @@
org.springframework.aot.hint.RuntimeHintsRegistrar=\
org.springframework.data.r2dbc.aot.R2dbcRuntimeHints
org.springframework.data.r2dbc.aot.R2dbcRuntimeHintsRegistrar