Interface RepositoryConfigurationSource

All Known Implementing Classes:
AnnotationRepositoryConfigurationSource, RepositoryConfigurationSourceSupport, XmlRepositoryConfigurationSource

public interface RepositoryConfigurationSource
Interface containing the configurable options for the Spring Data repository subsystem.
Author:
Oliver Gierke, Thomas Darimont, Peter Rietzler, Jens Schauder, Mark Paluch, Johannes Englmeier
  • Method Details

    • getSource

      @Nullable Object getSource()
      Returns the actual source object that the configuration originated from. Will be used by the tooling to give visual feedback on where the repository instances actually come from. @return.
    • getBasePackages

      Streamable<String> getBasePackages()
      Returns the base packages the repository interfaces shall be found under.
      Returns:
      must not be null.
    • getQueryLookupStrategyKey

      Optional<Object> getQueryLookupStrategyKey()
      Returns the QueryLookupStrategy.Key to define how query methods shall be resolved.
      Returns:
    • getRepositoryImplementationPostfix

      Optional<String> getRepositoryImplementationPostfix()
      Returns the configured postfix to be used for looking up custom implementation classes.
      Returns:
      the postfix to use or Optional.empty() in case none is configured.
    • getNamedQueryLocation

      Optional<String> getNamedQueryLocation()
      Returns:
    • getRepositoryBaseClassName

      Optional<String> getRepositoryBaseClassName()
      Returns the name of the repository base class to be used or Optional.empty() if the store specific defaults shall be applied.
      Returns:
      Since:
      1.11
    • getRepositoryFactoryBeanClassName

      Optional<String> getRepositoryFactoryBeanClassName()
      Returns the name of the repository factory bean class or Optional.empty() if not defined in the source.
      Returns:
    • getCandidates

      Streamable<org.springframework.beans.factory.config.BeanDefinition> getCandidates(org.springframework.core.io.ResourceLoader loader)
      Returns the source BeanDefinitions of the repository interfaces to create repository instances for.
      Parameters:
      loader -
      Returns:
    • getAttribute

      Optional<String> getAttribute(String name)
      Returns the value for the String attribute with the given name. The name is expected to be handed in camel-case.
      Parameters:
      name - must not be null or empty.
      Returns:
      the attribute with the given name or Optional.empty() if not configured or empty.
      Since:
      1.8
    • getAttribute

      <T> Optional<T> getAttribute(String name, Class<T> type)
      Returns the value for the attribute with the given name and type. The name is expected to be handed in camel-case.
      Parameters:
      name - must not be null or empty.
      type - the type of the attribute to look up.
      Returns:
      the attribute with the given name or Optional.empty() if not configured or empty.
      Since:
      2.2
    • getRequiredAttribute

      default <T> T getRequiredAttribute(String name, Class<T> type)
      Returns the attribute value for the attribute of the given name.
      Parameters:
      name - must not be null or empty.
      Returns:
      the attribute with the given name and type.
      Since:
      2.2
    • usesExplicitFilters

      boolean usesExplicitFilters()
      Returns whether the configuration uses explicit filtering to scan for repository types.
      Returns:
      whether the configuration uses explicit filtering to scan for repository types.
      Since:
      1.9
    • getExcludeFilters

      Streamable<org.springframework.core.type.filter.TypeFilter> getExcludeFilters()
      Return the TypeFilters to define which types to exclude when scanning for repositories or repository implementations.
      Returns:
      must not be null.
    • generateBeanName

      String generateBeanName(org.springframework.beans.factory.config.BeanDefinition beanDefinition)
      Returns a name for the beanDefinition.
      Parameters:
      beanDefinition - must not be null.
      Returns:
      Since:
      2.0
    • toImplementationDetectionConfiguration

      ImplementationDetectionConfiguration toImplementationDetectionConfiguration(org.springframework.core.type.classreading.MetadataReaderFactory factory)
      Returns the ImplementationDetectionConfiguration to be used to scan for custom implementations of the repository instances to be created from this RepositoryConfigurationSource.
      Parameters:
      factory -
      Returns:
      will never be null.
      Since:
      2.1
    • getBootstrapMode

      BootstrapMode getBootstrapMode()
      Defines the repository BootstrapMode to be used.
      Returns:
      Since:
      2.1
    • getResourceDescription

      @Nullable String getResourceDescription()
      Returns a human readable description of the repository configuration source for error reporting purposes.
      Returns:
      can be null.
      Since:
      2.3