@Override
    default void destroy() {
        FunctionUtils.doAndHandle(__ -> getEntityManager().close());
    }
Create entity manager.

@return the entity manager
support/cas-server-support-jpa-util/src/main/java/org/apereo/cas/configuration/support/JpaPersistenceUnitProvider.java