Java 类org.hibernate.context.spi.CurrentTenantIdentifierResolver 实例源码

项目:xm-uaa    文件:DatabaseConfiguration.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
    DataSource dataSource,
    MultiTenantConnectionProvider multiTenantConnectionProviderImpl,
    CurrentTenantIdentifierResolver currentTenantIdentifierResolverImpl) {
    Map<String, Object> properties = new HashMap<>();
    properties.putAll(jpaProperties.getHibernateProperties(dataSource));
    properties.put(org.hibernate.cfg.Environment.MULTI_TENANT, MultiTenancyStrategy.SCHEMA);
    properties
        .put(org.hibernate.cfg.Environment.MULTI_TENANT_CONNECTION_PROVIDER, multiTenantConnectionProviderImpl);
    properties
        .put(org.hibernate.cfg.Environment.MULTI_TENANT_IDENTIFIER_RESOLVER, currentTenantIdentifierResolverImpl);

    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(dataSource);
    em.setPackagesToScan(JPA_PACKAGES);
    em.setJpaVendorAdapter(jpaVendorAdapter());
    em.setJpaPropertyMap(properties);
    return em;
}
项目:xm-ms-balance    文件:DatabaseConfiguration.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
    DataSource dataSource,
    MultiTenantConnectionProvider multiTenantConnectionProviderImpl,
    CurrentTenantIdentifierResolver currentTenantIdentifierResolverImpl,
    LocalValidatorFactoryBean localValidatorFactoryBean) {

    Map<String, Object> properties = new HashMap<>();
    properties.putAll(jpaProperties.getHibernateProperties(dataSource));
    properties.put(MULTI_TENANT, MultiTenancyStrategy.SCHEMA);
    properties.put(MULTI_TENANT_CONNECTION_PROVIDER, multiTenantConnectionProviderImpl);
    properties.put(MULTI_TENANT_IDENTIFIER_RESOLVER, currentTenantIdentifierResolverImpl);
    properties.put(JPA_VALIDATION_FACTORY, localValidatorFactoryBean);

    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(dataSource);
    em.setPackagesToScan(JPA_PACKAGES);
    em.setJpaVendorAdapter(jpaVendorAdapter());
    em.setJpaPropertyMap(properties);
    return em;
}
项目:xm-ms-dashboard    文件:DatabaseConfiguration.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
    MultiTenantConnectionProvider multiTenantConnectionProviderImpl,
    CurrentTenantIdentifierResolver currentTenantIdentifierResolverImpl) {
    Map<String, Object> properties = new HashMap<>();
    properties.putAll(jpaProperties.getHibernateProperties(dataSource));
    properties.put(org.hibernate.cfg.Environment.MULTI_TENANT, MultiTenancyStrategy.SCHEMA);
    properties
        .put(org.hibernate.cfg.Environment.MULTI_TENANT_CONNECTION_PROVIDER, multiTenantConnectionProviderImpl);
    properties
        .put(org.hibernate.cfg.Environment.MULTI_TENANT_IDENTIFIER_RESOLVER, currentTenantIdentifierResolverImpl);

    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(dataSource);
    em.setPackagesToScan(JPA_PACKAGES);
    em.setJpaVendorAdapter(jpaVendorAdapter());
    em.setJpaPropertyMap(properties);
    return em;
}
项目:cloud-s4-sdk-examples    文件:HibernateConfig.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource, MultiTenantConnectionProvider multiTenantConnectionProvider,
                                                                   CurrentTenantIdentifierResolver tenantIdentifierResolver) {
    final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(dataSource);
    em.setPackagesToScan("com.mycompany.models");

    em.setJpaVendorAdapter(this.jpaVendorAdapter());

    final Map<String, Object> jpaProperties = new HashMap<>();
    jpaProperties.put(Environment.MULTI_TENANT, MultiTenancyStrategy.SCHEMA);
    jpaProperties.put(Environment.MULTI_TENANT_CONNECTION_PROVIDER, multiTenantConnectionProvider);
    jpaProperties.put(Environment.MULTI_TENANT_IDENTIFIER_RESOLVER, tenantIdentifierResolver);
    jpaProperties.put(Environment.FORMAT_SQL, true);

    em.setJpaPropertyMap(jpaProperties);
    return em;
}
项目:spring-boot-multitenant    文件:HibernateConfig.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
    MultiTenantConnectionProvider multiTenantConnectionProviderImpl,
    CurrentTenantIdentifierResolver currentTenantIdentifierResolverImpl) {
  Map<String, Object> properties = new HashMap<>();
  properties.putAll(jpaProperties.getHibernateProperties(dataSource));
  properties.put(Environment.MULTI_TENANT, MultiTenancyStrategy.SCHEMA);
  properties.put(Environment.MULTI_TENANT_CONNECTION_PROVIDER, multiTenantConnectionProviderImpl);
  properties.put(Environment.MULTI_TENANT_IDENTIFIER_RESOLVER, currentTenantIdentifierResolverImpl);

  LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
  em.setDataSource(dataSource);
  em.setPackagesToScan("com.srai");
  em.setJpaVendorAdapter(jpaVendorAdapter());
  em.setJpaPropertyMap(properties);
  return em;
}
项目:xm-ms-entity    文件:DatabaseConfiguration.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
                                                                   MultiTenantConnectionProvider multiTenantConnectionProviderImpl,
                                                                   CurrentTenantIdentifierResolver currentTenantIdentifierResolverImpl,
                                                                   LocalValidatorFactoryBean localValidatorFactoryBean) {
    Map<String, Object> properties = new HashMap<>();
    properties.putAll(jpaProperties.getHibernateProperties(dataSource));
    properties.put(org.hibernate.cfg.Environment.MULTI_TENANT, MultiTenancyStrategy.SCHEMA);
    properties
        .put(org.hibernate.cfg.Environment.MULTI_TENANT_CONNECTION_PROVIDER, multiTenantConnectionProviderImpl);
    properties
        .put(org.hibernate.cfg.Environment.MULTI_TENANT_IDENTIFIER_RESOLVER, currentTenantIdentifierResolverImpl);

    properties.put(JPA_VALIDATION_FACTORY, localValidatorFactoryBean);

    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(dataSource);
    em.setPackagesToScan(JPA_PACKAGES);
    em.setJpaVendorAdapter(jpaVendorAdapter());
    em.setJpaPropertyMap(properties);
    return em;
}
项目:lams    文件:SessionFactoryImpl.java   
@SuppressWarnings({ "unchecked" })
private CurrentTenantIdentifierResolver determineCurrentTenantIdentifierResolver(
        CurrentTenantIdentifierResolver explicitResolver) {
    if ( explicitResolver != null ) {
        return explicitResolver;
    }
    return serviceRegistry.getService( ConfigurationService.class )
            .getSetting(
                    AvailableSettings.MULTI_TENANT_IDENTIFIER_RESOLVER,
                    CurrentTenantIdentifierResolver.class,
                    null
            );

}
项目:hibernate-dynamic-dialects    文件:SessionFactoryImpl.java   
@SuppressWarnings({ "unchecked" })
private CurrentTenantIdentifierResolver determineCurrentTenantIdentifierResolver(
        CurrentTenantIdentifierResolver explicitResolver) {
    if (explicitResolver != null) {
        return explicitResolver;
    }
    return serviceRegistry.getService(ConfigurationService.class)
            .getSetting(AvailableSettings.MULTI_TENANT_IDENTIFIER_RESOLVER,
                    CurrentTenantIdentifierResolver.class, null);

}
项目:lemon    文件:SessionFactoryWrapper.java   
public CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver() {
    return sessionFactoryImplementor.getCurrentTenantIdentifierResolver();
}
项目:lams    文件:Configuration.java   
public CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver() {
    return currentTenantIdentifierResolver;
}
项目:lams    文件:Configuration.java   
public void setCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver currentTenantIdentifierResolver) {
    this.currentTenantIdentifierResolver = currentTenantIdentifierResolver;
}
项目:lams    文件:SessionFactoryImpl.java   
@Override
public CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver() {
    return currentTenantIdentifierResolver;
}
项目:hibernate-dynamic-dialects    文件:SessionFactoryImpl.java   
@Override
public CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver() {
    return currentTenantIdentifierResolver;
}
项目:spring4-understanding    文件:LocalSessionFactoryBean.java   
/**
 * Set a {@link CurrentTenantIdentifierResolver} to be passed on to the SessionFactory.
 * @see LocalSessionFactoryBuilder#setCurrentTenantIdentifierResolver
 */
public void setCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver currentTenantIdentifierResolver) {
    this.currentTenantIdentifierResolver = currentTenantIdentifierResolver;
}
项目:hibernate-plus    文件:HibernateSpringSessionFactoryBean.java   
/**
 * Set a {@link CurrentTenantIdentifierResolver} to be passed on to the
 * SessionFactory.
 *
 * @see HibernateSpringSessionFactoryBuilder#setCurrentTenantIdentifierResolver
 */
public void setCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver currentTenantIdentifierResolver) {
    this.currentTenantIdentifierResolver = currentTenantIdentifierResolver;
}
项目:hibernate-plus    文件:HibernateSpringSessionFactoryBuilder.java   
/**
 * Overridden to reliably pass a {@link CurrentTenantIdentifierResolver} to the SessionFactory.
 *
 * @see AvailableSettings#MULTI_TENANT_IDENTIFIER_RESOLVER
 * @since 4.3.2
 */
@Override
public void setCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver currentTenantIdentifierResolver) {
    getProperties().put(AvailableSettings.MULTI_TENANT_IDENTIFIER_RESOLVER, currentTenantIdentifierResolver);
    super.setCurrentTenantIdentifierResolver(currentTenantIdentifierResolver);
}
项目:lams    文件:SessionFactoryImplementor.java   
public CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver();