@Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public EntityManagerFactory umaEntityManagerFactory(
            final ConfigurableApplicationContext applicationContext,
            final CasConfigurationProperties casProperties,
            @Qualifier("jpaUmaVendorAdapter")
            final JpaVendorAdapter jpaUmaVendorAdapter,
            @Qualifier("dataSourceUma")
            final DataSource dataSourceUma,
            @Qualifier("jpaUmaPackagesToScan")
            final BeanContainer<String> jpaUmaPackagesToScan,
            @Qualifier(JpaBeanFactory.DEFAULT_BEAN_NAME)
            final JpaBeanFactory jpaBeanFactory) {
            return BeanSupplier.of(EntityManagerFactory.class)
                .when(CONDITION.given(applicationContext.getEnvironment()))
                .supply(Unchecked.supplier(() -> {
                    val ctx = JpaConfigurationContext.builder()
                        .jpaVendorAdapter(jpaUmaVendorAdapter)
                        .persistenceUnitName("umaResourceJpaContext")
                        .dataSource(dataSourceUma)
                        .packagesToScan(jpaUmaPackagesToScan.toSet())
                        .build();
                    return jpaBeanFactory.newEntityManagerFactoryBean(ctx,
                        casProperties.getAuthn().getOauth().getUma().getResourceSet().getJpa()).getObject();
                }))
                .otherwiseProxy()
                .get();
        }
This is {@link CasOAuthUmaJpaAutoConfiguration}.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-oauth-uma-jpa/src/main/java/org/apereo/cas/config/CasOAuthUmaJpaAutoConfiguration.java