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 Summary
Modifier and TypeMethodDescriptiongenerateBeanName
(BeanDefinition beanDefinition) Returns a name for the beanDefinition.getAttribute
(String name) Returns the value for theString
attribute with the given name.<T> Optional<T>
getAttribute
(String name, Class<T> type) Returns the value for the attribute with the given name and type.Returns the base packages the repository interfaces shall be found under.Defines the repositoryBootstrapMode
to be used.getCandidates
(ResourceLoader loader) Returns the sourceBeanDefinition
s of the repository interfaces to create repository instances for.Return theTypeFilter
s to define which types to exclude when scanning for repositories or repository implementations.Returns theQueryLookupStrategy.Key
to define how query methods shall be resolved.Returns the name of the repository base class to be used orOptional.empty()
if the store specific defaults shall be applied.Returns the name of the repository factory bean class orOptional.empty()
if not defined in the source.Returns the configured postfix to be used for looking up custom implementation classes.default <T> T
getRequiredAttribute
(String name, Class<T> type) Returns the attribute value for the attribute of the given name.Returns a human readable description of the repository configuration source for error reporting purposes.Returns the actual source object that the configuration originated from.Returns theImplementationDetectionConfiguration
to be used to scan for custom implementations of the repository instances to be created from thisRepositoryConfigurationSource
.boolean
Returns whether the configuration uses explicit filtering to scan for repository types.
-
Method Details
-
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
Returns theQueryLookupStrategy.Key
to define how query methods shall be resolved.- Returns:
-
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
- Returns:
-
getRepositoryBaseClassName
Returns the name of the repository base class to be used orOptional.empty()
if the store specific defaults shall be applied.- Returns:
- Since:
- 1.11
-
getRepositoryFactoryBeanClassName
Returns the name of the repository factory bean class orOptional.empty()
if not defined in the source.- Returns:
-
getCandidates
Returns the sourceBeanDefinition
s of the repository interfaces to create repository instances for.- Parameters:
loader
-- Returns:
-
getAttribute
Returns the value for theString
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
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
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<TypeFilter> getExcludeFilters()Return theTypeFilter
s to define which types to exclude when scanning for repositories or repository implementations.- Returns:
- must not be null.
-
generateBeanName
Returns a name for the beanDefinition.- Parameters:
beanDefinition
- must not be null.- Returns:
- Since:
- 2.0
-
toImplementationDetectionConfiguration
ImplementationDetectionConfiguration toImplementationDetectionConfiguration(MetadataReaderFactory factory) Returns theImplementationDetectionConfiguration
to be used to scan for custom implementations of the repository instances to be created from thisRepositoryConfigurationSource
.- Parameters:
factory
-- Returns:
- will never be null.
- Since:
- 2.1
-
getBootstrapMode
BootstrapMode getBootstrapMode()Defines the repositoryBootstrapMode
to be used.- Returns:
- Since:
- 2.1
-
getResourceDescription
Returns a human readable description of the repository configuration source for error reporting purposes.- Returns:
- can be null.
- Since:
- 2.3
-