类 SpringMultiTenantConfiguration


  • @Configuration
    @AutoConfigureBefore(com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure.class)
    @EnableConfigurationProperties(org.springframework.boot.autoconfigure.orm.jpa.JpaProperties.class)
    @EnableTransactionManagement(proxyTargetClass=true,
                                 mode=ASPECTJ)
    @Y9EnableJpaRepositories(basePackages="${y9.feature.jpa.packagesToScanRepositoryTenant}",
                             includeFilters=,
                             entityManagerFactoryRef="rsTenantEntityManagerFactory",
                             transactionManagerRef="rsTenantTransactionManager")
    public class SpringMultiTenantConfiguration
    extends Object
    • 构造器详细资料

      • SpringMultiTenantConfiguration

        public SpringMultiTenantConfiguration()
    • 方法详细资料

      • defaultDataSource

        @Bean("defaultDataSource")
        @ConditionalOnMissingBean(name="defaultDataSource")
        public com.alibaba.druid.pool.DruidDataSource defaultDataSource​(org.springframework.core.env.Environment environment)
      • jdbcTemplate4Tenant

        @Bean("jdbcTemplate4Tenant")
        @ConditionalOnMissingBean(name="jdbcTemplate4Tenant")
        public org.springframework.jdbc.core.JdbcTemplate jdbcTemplate4Tenant​(@Qualifier("y9TenantDataSource")
                                                                              DataSource ds)
      • jpaVendorAdapter

        @Bean
        @ConditionalOnMissingBean
        public org.springframework.orm.jpa.JpaVendorAdapter jpaVendorAdapter()
      • rsTenantEntityManagerFactory

        @Primary
        @Bean({"rsTenantEntityManagerFactory","entityManagerFactory"})
        public org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean rsTenantEntityManagerFactory​(@Qualifier("y9TenantDataSource")
                                                                                                               DataSource ds,
                                                                                                               org.springframework.boot.autoconfigure.orm.jpa.JpaProperties jpaProperties,
                                                                                                               org.springframework.core.env.Environment environment)
      • rsTenantTransactionManager

        @Primary
        @Bean({"rsTenantTransactionManager","transactionManager"})
        public org.springframework.transaction.PlatformTransactionManager rsTenantTransactionManager​(@Qualifier("rsTenantEntityManagerFactory")
                                                                                                     javax.persistence.EntityManagerFactory emf)
      • y9PublicDS

        @ConfigurationProperties("spring.datasource.druid.y9-public")
        @Bean(name="y9PublicDS")
        @ConditionalOnMissingBean(name="y9PublicDS")
        public com.alibaba.druid.pool.DruidDataSource y9PublicDS()
      • jdbcTemplate4Public

        @Bean(name="jdbcTemplate4Public")
        @ConditionalOnMissingBean(name="jdbcTemplate4Public")
        public org.springframework.jdbc.core.JdbcTemplate jdbcTemplate4Public​(@Qualifier("y9PublicDS")
                                                                              com.alibaba.druid.pool.DruidDataSource y9PublicDS)
      • y9TenantDataSource

        @Primary
        @Bean("y9TenantDataSource")
        @ConditionalOnMissingBean(name="y9TenantDataSource")
        public DataSource y9TenantDataSource​(@Qualifier("defaultDataSource")
                                             com.alibaba.druid.pool.DruidDataSource defaultDataSource,
                                             @Qualifier("y9TenantDataSourceLookup")
                                             Y9TenantDataSourceLookup y9TenantDataSourceLookup)
      • y9TenantDataSourceLookup

        @Bean("y9TenantDataSourceLookup")
        public Y9TenantDataSourceLookup y9TenantDataSourceLookup​(@Qualifier("y9PublicDS")
                                                                 com.alibaba.druid.pool.DruidDataSource ds,
                                                                 org.springframework.core.env.Environment environment)