Class AotRepositoryBeanDefinitionPropertiesDecorator

java.lang.Object
org.springframework.data.repository.aot.generate.AotRepositoryBeanDefinitionPropertiesDecorator

public class AotRepositoryBeanDefinitionPropertiesDecorator extends Object
Delegate to decorate AOT BeanDefinition properties during AOT processing. Adds a CodeBlock for the fragment function that resolves RepositoryContributor.requiredArgs() from the BeanFactory and provides them to the generated repository fragment.
Since:
4.0
Author:
Mark Paluch, Christoph Strobl
  • 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 - if RepositoryContributor.getContributedTypeName() is not set.
  • Method Details

    • decorate

      public org.springframework.javapoet.CodeBlock decorate()
      Generate a decorated code block for bean properties.

      NOTE: the RepositoryContributor must be able to provide the to be type name of the generated repository implementation and needs to have potential constructor arguments resolved.

      Returns:
      the decorated code block.