@Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public FactoryBean<EntityManagerFactory> samlMetadataEntityManagerFactory(
            final CasConfigurationProperties casProperties,
            @Qualifier("jpaSamlMetadataVendorAdapter")
            final JpaVendorAdapter jpaSamlMetadataVendorAdapter,
            @Qualifier("dataSourceSamlMetadata")
            final DataSource dataSourceSamlMetadata,
            @Qualifier("jpaSamlMetadataPackagesToScan")
            final BeanContainer<String> jpaSamlMetadataPackagesToScan,
            @Qualifier(JpaBeanFactory.DEFAULT_BEAN_NAME)
            final JpaBeanFactory jpaBeanFactory) {
            val idp = casProperties.getAuthn().getSamlIdp().getMetadata();
            val ctx = JpaConfigurationContext.builder().jpaVendorAdapter(jpaSamlMetadataVendorAdapter)
                .persistenceUnitName("jpaSamlMetadataContext").dataSource(dataSourceSamlMetadata)
                .packagesToScan(jpaSamlMetadataPackagesToScan.toSet()).build();
            return jpaBeanFactory.newEntityManagerFactoryBean(ctx, idp.getJpa());
        }
This is {@link SamlIdPJpaRegisteredServiceMetadataConfiguration}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-saml-idp-metadata-jpa/src/main/java/org/apereo/cas/config/SamlIdPJpaRegisteredServiceMetadataConfiguration.java