Package org.springframework.data.aot
Class RepositoryRegistrationAotContribution
java.lang.Object
org.springframework.data.aot.RepositoryRegistrationAotContribution
- All Implemented Interfaces:
BeanRegistrationAotContribution
public class RepositoryRegistrationAotContribution
extends Object
implements BeanRegistrationAotContribution
BeanRegistrationAotContribution
used to contribute repository registrations.- Since:
- 3.0
- Author:
- John Blum
-
Constructor Summary
ModifierConstructorDescriptionprotected
RepositoryRegistrationAotContribution
(RepositoryRegistrationAotProcessor repositoryRegistrationAotProcessor) Constructs a new instance of theRepositoryRegistrationAotContribution
initialized with the given, requiredRepositoryRegistrationAotProcessor
from which this contribution was created. -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyTo
(GenerationContext generationContext, BeanRegistrationCode beanRegistrationCode) protected org.springframework.data.aot.DefaultAotRepositoryContext
buildAotRepositoryContext
(RegisteredBean bean, RepositoryConfiguration<?> repositoryMetadata) protected void
enhanceRepositoryBeanDefinition
(RegisteredBean repositoryBean, RepositoryConfiguration<?> repositoryMetadata, AotRepositoryContext repositoryContext) Helps the AOT processing render theFactoryBean
type correctly that is used to tell the outcome of theFactoryBean
.forBean
(RegisteredBean repositoryBean) Builds aRepositoryRegistrationAotContribution
for given, requiredRegisteredBean
representing theRepository
registered in the bean registry.fromProcessor
(RepositoryRegistrationAotProcessor repositoryRegistrationAotProcessor) Factory method used to construct a new instance ofRepositoryRegistrationAotContribution
initialized with the given, requiredRepositoryRegistrationAotProcessor
from which this contribution was created.protected ConfigurableListableBeanFactory
protected Optional<BiConsumer<AotRepositoryContext,
GenerationContext>> protected AotRepositoryContext
protected RepositoryRegistrationAotProcessor
withModuleContribution
(BiConsumer<AotRepositoryContext, GenerationContext> moduleContribution) Callback
for data module specific contributions.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.aot.BeanRegistrationAotContribution
customizeBeanRegistrationCodeFragments
-
Constructor Details
-
RepositoryRegistrationAotContribution
protected RepositoryRegistrationAotContribution(RepositoryRegistrationAotProcessor repositoryRegistrationAotProcessor) Constructs a new instance of theRepositoryRegistrationAotContribution
initialized with the given, requiredRepositoryRegistrationAotProcessor
from which this contribution was created.- Parameters:
repositoryRegistrationAotProcessor
- reference back to theRepositoryRegistrationAotProcessor
from which this contribution was created.- Throws:
IllegalArgumentException
- if theRepositoryRegistrationAotProcessor
is null.- See Also:
-
-
Method Details
-
fromProcessor
public static RepositoryRegistrationAotContribution fromProcessor(RepositoryRegistrationAotProcessor repositoryRegistrationAotProcessor) Factory method used to construct a new instance ofRepositoryRegistrationAotContribution
initialized with the given, requiredRepositoryRegistrationAotProcessor
from which this contribution was created.- Parameters:
repositoryRegistrationAotProcessor
- reference back to theRepositoryRegistrationAotProcessor
from which this contribution was created.- Returns:
- a new instance of
RepositoryRegistrationAotContribution
. - Throws:
IllegalArgumentException
- if theRepositoryRegistrationAotProcessor
is null.- See Also:
-
getBeanFactory
-
getModuleContribution
-
getRepositoryContext
-
getRepositoryRegistrationAotProcessor
-
getRepositoryInformation
-
forBean
Builds aRepositoryRegistrationAotContribution
for given, requiredRegisteredBean
representing theRepository
registered in the bean registry.- Parameters:
repositoryBean
-RegisteredBean
for theRepository
; must not be null.- Returns:
- a
RepositoryRegistrationAotContribution
to contribute AOT metadata and code for theRepository
RegisteredBean
. - Throws:
IllegalArgumentException
- if theRegisteredBean
is null.- See Also:
-
buildAotRepositoryContext
protected org.springframework.data.aot.DefaultAotRepositoryContext buildAotRepositoryContext(RegisteredBean bean, RepositoryConfiguration<?> repositoryMetadata) -
enhanceRepositoryBeanDefinition
protected void enhanceRepositoryBeanDefinition(RegisteredBean repositoryBean, RepositoryConfiguration<?> repositoryMetadata, AotRepositoryContext repositoryContext) Helps the AOT processing render theFactoryBean
type correctly that is used to tell the outcome of theFactoryBean
. We just need to set the targetRepository
type
of theRepositoryFactoryBeanSupport
while keeping the actual ID and DomainType set toObject
. If the generic type signature does not match, then we do not try to resolve and remap the types, but rather set the factoryBeanObjectType attribute on theRootBeanDefinition
. -
withModuleContribution
public RepositoryRegistrationAotContribution withModuleContribution(@Nullable BiConsumer<AotRepositoryContext, GenerationContext> moduleContribution) Callback
for data module specific contributions.- Parameters:
moduleContribution
-BiConsumer
used by data modules to submit contributions; can be null.- Returns:
- this.
-
applyTo
- Specified by:
applyTo
in interfaceBeanRegistrationAotContribution
-
typeFilter
-