<property name="hibernate.multiTenancy" value="DATABASE" />
<property name="hibernate.tenant_identifier_resolver" value="sk.seges.hroddelenie.configuration.MultiTenantIdentifierResolver" />
<property name="hibernate.multi_tenant_connection_provider" value="org.hibernate.service.jdbc.connections.spi.DataSourceBasedMultiTenantConnectionProviderImpl" />
<property name="hibernate.connection.datasource" value="java:comp/env/jdbc/hr" />
<property name="hibernate.multi_tenant.datasource.identifier_for_any" value="default" />
hibernate.tenant_identifier_resolver
hibernate.multi_tenant_connection_provider
Hibernate's DataSourceBasedMultiTenantConnectionProviderImpl utilizes JNDI lookups
hibernate.connection.datasource
hibernate.multi_tenant.datasource.identifier_for_any
So in the end = java:comp/env/jdbc/hr/default
then you need custom exporter
but don't forget the AuditConfiguration
Ejb3Configuration jpaConfiguration = new Ejb3Configuration().configure(
unitName, null);
Configuration hibernateConfiguration = jpaConfiguration
.getHibernateConfiguration();
hibernateConfiguration.buildMappings();
AuditConfiguration auditConfiguration = AuditConfiguration.getFor(hibernateConfiguration);
and use EnversSchemaGenerator at last
{ "hibernate.multiTenancy",
"hibernate.tenant_identifier_resolver",
"hibernate.multi_tenant_connection_provider",
"hibernate.connection.datasource",
"hibernate.multi_tenant.datasource.identifier_for_any" }
MultiTenantSpringLiquibase
it is maintenable but generated SQL needs to be checked
existing databases must be moved to "point 0"
MDC.put("tenant", clientOrgz);
log4j.appender.stdout.layout.ConversionPattern = APP [%d{ISO8601}] - %-5p [%t|%X{tenant}|%X{requestId}] %F:%M %-30.30c{1} - %m%n