DATAJPA-834 - Use less common bean name for EntityManagerBeanDefinitionRegistrarPostProcessor.

Replacing bean name "foo" with more meaningful value injected via constant as a bean probably shouldn't have "foo" as its name when everything else has meaningful values defined in constants. Renamed bean and extracted constant alongside others referenced within the file.

Original pull request: #159.
This commit is contained in:
Andrew Walters
2015-12-03 17:10:06 +00:00
committed by Oliver Gierke
parent f77432d435
commit a87fda54f7
2 changed files with 2 additions and 1 deletions

View File

@@ -24,4 +24,5 @@ package org.springframework.data.jpa.repository.config;
interface BeanDefinitionNames {
public static final String JPA_MAPPING_CONTEXT_BEAN_NAME = "jpaMappingContext";
public static final String EM_BEAN_DEFINITION_REGISTRAR_POST_PROCESSOR_BEAN_NAME = "emBeanDefinitionRegistrarPostProcessor";
}

View File

@@ -163,7 +163,7 @@ public class JpaRepositoryConfigExtension extends RepositoryConfigurationExtensi
Object source = config.getSource();
registerIfNotAlreadyRegistered(new RootBeanDefinition(EntityManagerBeanDefinitionRegistrarPostProcessor.class),
registry, "foo", source);
registry, EM_BEAN_DEFINITION_REGISTRAR_POST_PROCESSOR_BEAN_NAME, source);
registerIfNotAlreadyRegistered(new RootBeanDefinition(JpaMetamodelMappingContextFactoryBean.class), registry,
JPA_MAPPING_CONTEXT_BEAN_NAME, source);