Example usage for org.hibernate.cfg AvailableSettings BEAN_CONTAINER

List of usage examples for org.hibernate.cfg AvailableSettings BEAN_CONTAINER

Introduction

In this page you can find the example usage for org.hibernate.cfg AvailableSettings BEAN_CONTAINER.

Prototype

String BEAN_CONTAINER

To view the source code for org.hibernate.cfg AvailableSettings BEAN_CONTAINER.

Click Source Link

Document

Identifies an explicit org.hibernate.resource.beans.container.spi.BeanContainer to be used.

Usage

From source file:org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.java

License:Apache License

private List<HibernatePropertiesCustomizer> determineHibernatePropertiesCustomizers(
        PhysicalNamingStrategy physicalNamingStrategy, ImplicitNamingStrategy implicitNamingStrategy,
        ConfigurableListableBeanFactory beanFactory,
        List<HibernatePropertiesCustomizer> hibernatePropertiesCustomizers) {
    List<HibernatePropertiesCustomizer> customizers = new ArrayList<>();
    if (ClassUtils.isPresent("org.hibernate.resource.beans.container.spi.BeanContainer",
            getClass().getClassLoader())) {
        customizers.add((properties) -> properties.put(AvailableSettings.BEAN_CONTAINER,
                new SpringBeanContainer(beanFactory)));
    }// ww w .ja  v a2s  . co  m
    if (physicalNamingStrategy != null || implicitNamingStrategy != null) {
        customizers.add(new NamingStrategiesHibernatePropertiesCustomizer(physicalNamingStrategy,
                implicitNamingStrategy));
    }
    customizers.addAll(hibernatePropertiesCustomizers);
    return customizers;
}