code: public static LocalContainerEntityManagerFactoryBean newHibernateEntityManagerFactoryBean(final JpaConfigDataHolder config,
                                                                                                final AbstractJpaProperties jpaProperties) {
          val bean = new LocalContainerEntityManagerFactoryBean();
          bean.setJpaVendorAdapter(config.getJpaVendorAdapter());
  
          if (StringUtils.isNotBlank(config.getPersistenceUnitName())) {
              bean.setPersistenceUnitName(config.getPersistenceUnitName());
          }
          bean.setPackagesToScan(config.getPackagesToScan().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
  
          if (config.getDataSource() != null) {
              bean.setDataSource(config.getDataSource());
          }
  
          val properties = new Properties();
          properties.put(Environment.DIALECT, jpaProperties.getDialect());
          properties.put(Environment.HBM2DDL_AUTO, jpaProperties.getDdlAuto());
          properties.put(Environment.STATEMENT_BATCH_SIZE, jpaProperties.getBatchSize());
          if (StringUtils.isNotBlank(jpaProperties.getDefaultCatalog())) {
              properties.put(Environment.DEFAULT_CATALOG, jpaProperties.getDefaultCatalog());
          }
          if (StringUtils.isNotBlank(jpaProperties.getDefaultSchema())) {
              properties.put(Environment.DEFAULT_SCHEMA, jpaProperties.getDefaultSchema());
          }
          properties.put(Environment.ENABLE_LAZY_LOAD_NO_TRANS, Boolean.TRUE);
          properties.put(Environment.FORMAT_SQL, Boolean.TRUE);
          properties.put("hibernate.connection.useUnicode", Boolean.TRUE);
          properties.put("hibernate.connection.characterEncoding", StandardCharsets.UTF_8.name());
          properties.put("hibernate.connection.charSet", StandardCharsets.UTF_8.name());
          if (StringUtils.isNotBlank(jpaProperties.getPhysicalNamingStrategyClassName())) {
              properties.put(Environment.PHYSICAL_NAMING_STRATEGY, jpaProperties.getPhysicalNamingStrategyClassName());
          }
          properties.putAll(jpaProperties.getProperties());
          bean.setJpaProperties(properties);
          return bean;
      }
docs: New entity manager factory bean.
  
  @param config        the config
  @param jpaProperties the jpa properties
  @return the local container entity manager factory bean