Search in sources :

Example 1 with JpaConfigDataHolder

use of org.apereo.cas.configuration.model.support.jpa.JpaConfigDataHolder in project cas by apereo.

the class GoogleAuthenticatorJpaConfiguration method googleAuthenticatorEntityManagerFactory.

@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean googleAuthenticatorEntityManagerFactory() {
    final LocalContainerEntityManagerFactoryBean bean = Beans.newHibernateEntityManagerFactoryBean(new JpaConfigDataHolder(jpaGoogleAuthenticatorVendorAdapter(), "jpaGoogleAuthenticatorContext", jpaPackagesToScanGoogleAuthenticator(), dataSourceGoogleAuthenticator()), casProperties.getAuthn().getMfa().getGauth().getJpa().getDatabase());
    bean.getJpaPropertyMap().put("hibernate.enable_lazy_load_no_trans", Boolean.TRUE);
    return bean;
}
Also used : JpaConfigDataHolder(org.apereo.cas.configuration.model.support.jpa.JpaConfigDataHolder) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean) Lazy(org.springframework.context.annotation.Lazy) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)

Example 2 with JpaConfigDataHolder

use of org.apereo.cas.configuration.model.support.jpa.JpaConfigDataHolder in project cas by apereo.

the class JdbcMultifactorAuthnTrustConfiguration method mfaTrustedAuthnEntityManagerFactory.

@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean mfaTrustedAuthnEntityManagerFactory() {
    final LocalContainerEntityManagerFactoryBean bean = Beans.newHibernateEntityManagerFactoryBean(new JpaConfigDataHolder(jpaMfaTrustedAuthnVendorAdapter(), "jpaMfaTrustedAuthnContext", jpaMfaTrustedAuthnPackagesToScan(), dataSourceMfaTrustedAuthn()), casProperties.getAuthn().getMfa().getTrusted().getJpa());
    bean.getJpaPropertyMap().put("hibernate.enable_lazy_load_no_trans", Boolean.TRUE);
    return bean;
}
Also used : JpaConfigDataHolder(org.apereo.cas.configuration.model.support.jpa.JpaConfigDataHolder) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean) Lazy(org.springframework.context.annotation.Lazy) Bean(org.springframework.context.annotation.Bean) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)

Example 3 with JpaConfigDataHolder

use of org.apereo.cas.configuration.model.support.jpa.JpaConfigDataHolder in project cas by apereo.

the class JpaEventsConfiguration method eventsEntityManagerFactory.

@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean eventsEntityManagerFactory() {
    final LocalContainerEntityManagerFactoryBean bean = Beans.newHibernateEntityManagerFactoryBean(new JpaConfigDataHolder(jpaEventVendorAdapter(), "jpaEventRegistryContext", jpaEventPackagesToScan(), dataSourceEvent()), casProperties.getEvents().getJpa());
    bean.getJpaPropertyMap().put("hibernate.enable_lazy_load_no_trans", Boolean.TRUE);
    return bean;
}
Also used : JpaConfigDataHolder(org.apereo.cas.configuration.model.support.jpa.JpaConfigDataHolder) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean) Lazy(org.springframework.context.annotation.Lazy) Bean(org.springframework.context.annotation.Bean) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)

Aggregations

JpaConfigDataHolder (org.apereo.cas.configuration.model.support.jpa.JpaConfigDataHolder)3 Bean (org.springframework.context.annotation.Bean)3 Lazy (org.springframework.context.annotation.Lazy)3 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)3 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1