Class BeanDefinitionUtils
java.lang.Object
org.springframework.data.jpa.util.BeanDefinitionUtils
Utility methods to work with
BeanDefinition
instances from BeanFactoryPostProcessor
s.- Author:
- Oliver Gierke, Mark Paluch
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Value object to represent aBeanDefinition
for anEntityManagerFactory
with a dedicated bean name. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.beans.factory.config.BeanDefinition
getBeanDefinition
(String name, org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) Returns theBeanDefinition
with the given name, obtained from the givenBeanFactory
or one of its parents.getEntityManagerFactoryBeanDefinitions
(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) ReturnsBeanDefinitionUtils.EntityManagerFactoryBeanDefinition
instances for allBeanDefinition
registered in the givenConfigurableListableBeanFactory
hierarchy.getEntityManagerFactoryBeanNames
(org.springframework.beans.factory.ListableBeanFactory beanFactory) Return all bean names for bean definitions that will result in anEntityManagerFactory
eventually.
-
Method Details
-
getEntityManagerFactoryBeanNames
public static Iterable<String> getEntityManagerFactoryBeanNames(org.springframework.beans.factory.ListableBeanFactory beanFactory) Return all bean names for bean definitions that will result in anEntityManagerFactory
eventually. We're checking forEntityManagerFactory
and the well-known factory beans here to avoid eager initialization of the factory beans. The double lookup is necessary especially for JavaConfig scenarios as people might declare anEntityManagerFactory
directly.- Parameters:
beanFactory
-- Returns:
-
getEntityManagerFactoryBeanDefinitions
public static Collection<BeanDefinitionUtils.EntityManagerFactoryBeanDefinition> getEntityManagerFactoryBeanDefinitions(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) ReturnsBeanDefinitionUtils.EntityManagerFactoryBeanDefinition
instances for allBeanDefinition
registered in the givenConfigurableListableBeanFactory
hierarchy.- Parameters:
beanFactory
- must not be null.- Returns:
-
getBeanDefinition
public static org.springframework.beans.factory.config.BeanDefinition getBeanDefinition(String name, org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) Returns theBeanDefinition
with the given name, obtained from the givenBeanFactory
or one of its parents.- Parameters:
name
-beanFactory
-- Returns:
-