@Override
    public EntityManagerFactory createContainerEntityManagerFactory(final PersistenceUnitInfo info, final Map properties) {
        val filtered = CollectionUtils.intersection(info.getManagedClassNames(), providerContext.getIncludeEntityClasses());
        if (info.getManagedClassNames().isEmpty() && !providerContext.getIncludeEntityClasses().isEmpty()) {
            filtered.addAll(providerContext.getIncludeEntityClasses());
        }
        LOGGER.trace("Filtered entity classes for entity manager are [{}]", filtered);
        val mergedClassesAndPackages = new HashSet<String>(filtered);
        if (info instanceof final SmartPersistenceUnitInfo sinfo) {
            mergedClassesAndPackages.addAll(sinfo.getManagedPackages());
        }
        val persistenceUnit = new CasPersistenceUnitInfoDescriptor(info, new ArrayList<>(mergedClassesAndPackages));
        return new EntityManagerFactoryBuilderImpl(persistenceUnit, properties).build();
    }
This is {@link CasHibernatePersistenceProvider}.

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