@Override
    public FactoryBean<EntityManagerFactory> newEntityManagerFactoryBean(final JpaConfigurationContext config,
                                                                         final AbstractJpaProperties jpaProperties) {
        val properties = new Properties();
        properties.put(JdbcSettings.DIALECT, jpaProperties.getDialect());
        properties.put(SchemaToolingSettings.HBM2DDL_AUTO, jpaProperties.getDdlAuto());
        properties.put(BatchSettings.STATEMENT_BATCH_SIZE, jpaProperties.getBatchSize());
        properties.put(StatisticsSettings.GENERATE_STATISTICS, jpaProperties.isGenerateStatistics());

        if (StringUtils.isNotBlank(jpaProperties.getDefaultCatalog())) {
            properties.put(MappingSettings.DEFAULT_CATALOG, jpaProperties.getDefaultCatalog());
        }
        if (StringUtils.isNotBlank(jpaProperties.getDefaultSchema())) {
            properties.put(MappingSettings.DEFAULT_SCHEMA, jpaProperties.getDefaultSchema());
        }
        properties.put(TransactionSettings.ENABLE_LAZY_LOAD_NO_TRANS, Boolean.TRUE);
        properties.put(JdbcSettings.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());
        properties.put(JdbcSettings.AUTOCOMMIT, jpaProperties.isAutocommit());
        properties.put(JdbcSettings.JDBC_TIME_ZONE, "UTC");
        properties.put(JdbcSettings.STATEMENT_FETCH_SIZE, jpaProperties.getFetchSize());

        FunctionUtils.doIfNotNull(jpaProperties.getPhysicalNamingStrategyClassName(),
            __ -> {
                val clazz = ClassUtils.getClass(JpaBeans.class.getClassLoader(), jpaProperties.getPhysicalNamingStrategyClassName());
                val namingStrategy = (PhysicalNamingStrategy) clazz.getDeclaredConstructor().newInstance();
                if (namingStrategy instanceof final ApplicationContextAware aware) {
                    aware.setApplicationContext(applicationContext);
                }
                properties.put(MappingSettings.PHYSICAL_NAMING_STRATEGY, namingStrategy);
            });
        properties.putAll(jpaProperties.getProperties());

        val bean = JpaBeans.newEntityManagerFactoryBean(config);
        bean.setJpaProperties(properties);
        bean.afterPropertiesSet();
        return bean;
    }
This is {@link CasHibernateJpaBeanFactory}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-jpa-hibernate/src/main/java/org/apereo/cas/hibernate/CasHibernateJpaBeanFactory.java