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, Donghun Shin
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Value object to represent aBeanDefinition
for anEntityManagerFactory
with a dedicated bean name. -
Method Summary
Modifier and TypeMethodDescriptionstatic BeanDefinition
getBeanDefinition
(String name, ConfigurableListableBeanFactory beanFactory) Returns theBeanDefinition
with the given name, obtained from the givenBeanFactory
or one of its parents.ReturnsBeanDefinitionUtils.EntityManagerFactoryBeanDefinition
instances for allBeanDefinition
registered in the givenConfigurableListableBeanFactory
hierarchy.getEntityManagerFactoryBeanNames
(ListableBeanFactory beanFactory) Return all bean names for bean definitions that will result in anEntityManagerFactory
eventually.
-
Method Details
-
getEntityManagerFactoryBeanNames
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(ConfigurableListableBeanFactory beanFactory) ReturnsBeanDefinitionUtils.EntityManagerFactoryBeanDefinition
instances for allBeanDefinition
registered in the givenConfigurableListableBeanFactory
hierarchy.- Parameters:
beanFactory
- must not be null.- Returns:
-
getBeanDefinition
public static BeanDefinition getBeanDefinition(String name, ConfigurableListableBeanFactory beanFactory) Returns theBeanDefinition
with the given name, obtained from the givenBeanFactory
or one of its parents.- Parameters:
name
-beanFactory
-- Returns:
-