本文整理汇总了Java中org.hibernate.context.spi.CurrentTenantIdentifierResolver类的典型用法代码示例。如果您正苦于以下问题:Java CurrentTenantIdentifierResolver类的具体用法?Java CurrentTenantIdentifierResolver怎么用?Java CurrentTenantIdentifierResolver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CurrentTenantIdentifierResolver类属于org.hibernate.context.spi包,在下文中一共展示了CurrentTenantIdentifierResolver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: entityManagerFactory
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
@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;
}
示例2: entityManagerFactory
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
@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;
}
示例3: entityManagerFactory
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
@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;
}
示例4: entityManagerFactory
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
@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;
}
示例5: entityManagerFactory
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
@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;
}
示例6: entityManagerFactory
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
@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;
}
示例7: determineCurrentTenantIdentifierResolver
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
@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
);
}
示例8: determineCurrentTenantIdentifierResolver
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
@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);
}
示例9: getCurrentTenantIdentifierResolver
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
public CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver() {
return sessionFactoryImplementor.getCurrentTenantIdentifierResolver();
}
示例10: getCurrentTenantIdentifierResolver
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
public CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver() {
return currentTenantIdentifierResolver;
}
示例11: setCurrentTenantIdentifierResolver
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
public void setCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver currentTenantIdentifierResolver) {
this.currentTenantIdentifierResolver = currentTenantIdentifierResolver;
}
示例12: getCurrentTenantIdentifierResolver
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
@Override
public CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver() {
return currentTenantIdentifierResolver;
}
示例13: setCurrentTenantIdentifierResolver
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
/**
* Set a {@link CurrentTenantIdentifierResolver} to be passed on to the SessionFactory.
* @see LocalSessionFactoryBuilder#setCurrentTenantIdentifierResolver
*/
public void setCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver currentTenantIdentifierResolver) {
this.currentTenantIdentifierResolver = currentTenantIdentifierResolver;
}
示例14: setCurrentTenantIdentifierResolver
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
/**
* Set a {@link CurrentTenantIdentifierResolver} to be passed on to the
* SessionFactory.
*
* @see HibernateSpringSessionFactoryBuilder#setCurrentTenantIdentifierResolver
*/
public void setCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver currentTenantIdentifierResolver) {
this.currentTenantIdentifierResolver = currentTenantIdentifierResolver;
}
示例15: setCurrentTenantIdentifierResolver
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; //导入依赖的package包/类
/**
* 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);
}