Class BeanDefinitionUtils

java.lang.Object
org.springframework.data.jpa.util.BeanDefinitionUtils

public final class BeanDefinitionUtils extends Object
Utility methods to work with BeanDefinition instances from BeanFactoryPostProcessors.
Author:
Oliver Gierke, Mark Paluch
  • 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 an EntityManagerFactory eventually. We're checking for EntityManagerFactory 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 an EntityManagerFactory directly.
      Parameters:
      beanFactory -
      Returns:
    • getEntityManagerFactoryBeanDefinitions

      public static Collection<BeanDefinitionUtils.EntityManagerFactoryBeanDefinition> getEntityManagerFactoryBeanDefinitions(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
      Returns BeanDefinitionUtils.EntityManagerFactoryBeanDefinition instances for all BeanDefinition registered in the given ConfigurableListableBeanFactory 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 the BeanDefinition with the given name, obtained from the given BeanFactory or one of its parents.
      Parameters:
      name -
      beanFactory -
      Returns: