Class AotRepositoryBeanDefinitionPropertiesDecorator
java.lang.Object
org.springframework.data.repository.aot.generate.AotRepositoryBeanDefinitionPropertiesDecorator
Delegate to decorate AOT
BeanDefinition properties during AOT processing. Adds a CodeBlock for the
fragment function that resolves RepositoryContributor.getAotFragmentMetadata() from the BeanFactory
and provides them to the generated repository fragment.- Since:
- 4.0
- Author:
- Mark Paluch, Christoph Strobl
-
Constructor Summary
ConstructorsConstructorDescriptionAotRepositoryBeanDefinitionPropertiesDecorator(Supplier<org.springframework.javapoet.CodeBlock> inheritedProperties, RepositoryContributor repositoryContributor) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.javapoet.CodeBlockdecorate()Generate a decorated code block for bean properties.
-
Constructor Details
-
AotRepositoryBeanDefinitionPropertiesDecorator
public AotRepositoryBeanDefinitionPropertiesDecorator(Supplier<org.springframework.javapoet.CodeBlock> inheritedProperties, RepositoryContributor repositoryContributor) - Parameters:
inheritedProperties- bean definition code (containing properties and such) already added via another component.repositoryContributor- the contributor providing the actual AOT repository implementation.- Throws:
IllegalArgumentException- ifRepositoryContributor.getContributedTypeName()is not set.
-
-
Method Details
-
decorate
public org.springframework.javapoet.CodeBlock decorate()Generate a decorated code block for bean properties.NOTE: the
RepositoryContributormust be able to provide the to betype nameof the generated repository implementation and needs to have potential constructor arguments resolved.- Returns:
- the decorated code block.
-