Revert exposing getModulePrefix() on RepositoryConfigurationExtension.
This is a breaking change as many modules implement a protected method. We're going to change this later with #2644. Original pull request: #2635. See #2634.
This commit is contained in:
@@ -170,7 +170,7 @@ class RepositoryBeanDefinitionBuilder {
|
||||
fragmentsBuilder.addConstructorArgValue(fragmentBeanNames);
|
||||
|
||||
String fragmentsBeanName = BeanDefinitionReaderUtils
|
||||
.uniqueBeanName(String.format("%s.%s.fragments", extension.getModulePrefix(),
|
||||
.uniqueBeanName(String.format("%s.%s.fragments", extension.getModuleName().toLowerCase(Locale.ROOT),
|
||||
ClassUtils.getShortName(configuration.getRepositoryInterface())), registry);
|
||||
registry.registerBeanDefinition(fragmentsBeanName, fragmentsBuilder.getBeanDefinition());
|
||||
return fragmentsBeanName;
|
||||
|
||||
@@ -15,15 +15,12 @@
|
||||
*/
|
||||
package org.springframework.data.repository.config;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* SPI to implement store specific extension to the repository bean definition registration process.
|
||||
@@ -39,18 +36,7 @@ public interface RepositoryConfigurationExtension {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
default String getModuleName() {
|
||||
return StringUtils.capitalize(getModulePrefix());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the prefix of the module to be used to create the default location for Spring Data named queries and module
|
||||
* specific bean definitions.
|
||||
*
|
||||
* @return must not be {@literal null}.
|
||||
* @since 3.0
|
||||
*/
|
||||
String getModulePrefix();
|
||||
String getModuleName();
|
||||
|
||||
/**
|
||||
* Returns all {@link RepositoryConfiguration}s obtained through the given {@link RepositoryConfigurationSource}.
|
||||
|
||||
@@ -60,6 +60,11 @@ public abstract class RepositoryConfigurationExtensionSupport implements Reposit
|
||||
|
||||
private boolean noMultiStoreSupport = false;
|
||||
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return StringUtils.capitalize(getModulePrefix());
|
||||
}
|
||||
|
||||
public <T extends RepositoryConfigurationSource> Collection<RepositoryConfiguration<T>> getRepositoryConfigurations(
|
||||
T configSource, ResourceLoader loader) {
|
||||
return getRepositoryConfigurations(configSource, loader, false);
|
||||
@@ -104,6 +109,13 @@ public abstract class RepositoryConfigurationExtensionSupport implements Reposit
|
||||
public void registerBeansForRoot(BeanDefinitionRegistry registry,
|
||||
RepositoryConfigurationSource configurationSource) {}
|
||||
|
||||
/**
|
||||
* Returns the prefix of the module to be used to create the default location for Spring Data named queries.
|
||||
*
|
||||
* @return must not be {@literal null}.
|
||||
*/
|
||||
protected abstract String getModulePrefix();
|
||||
|
||||
public void postProcess(BeanDefinitionBuilder builder, RepositoryConfigurationSource source) {}
|
||||
|
||||
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {}
|
||||
|
||||
Reference in New Issue
Block a user