|
|
|
@ -43,6 +43,7 @@ import org.hibernate.boot.registry.BootstrapServiceRegistryBuilder; |
|
|
|
import org.hibernate.cfg.AvailableSettings; |
|
|
|
import org.hibernate.cfg.AvailableSettings; |
|
|
|
import org.hibernate.cfg.Configuration; |
|
|
|
import org.hibernate.cfg.Configuration; |
|
|
|
import org.hibernate.cfg.Environment; |
|
|
|
import org.hibernate.cfg.Environment; |
|
|
|
|
|
|
|
import org.hibernate.context.spi.CurrentTenantIdentifierResolver; |
|
|
|
import org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider; |
|
|
|
import org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider; |
|
|
|
import org.hibernate.engine.spi.SessionFactoryImplementor; |
|
|
|
import org.hibernate.engine.spi.SessionFactoryImplementor; |
|
|
|
|
|
|
|
|
|
|
|
@ -206,6 +207,17 @@ public class LocalSessionFactoryBuilder extends Configuration { |
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Overridden to reliably pass a {@link CurrentTenantIdentifierResolver} to the SessionFactory. |
|
|
|
|
|
|
|
* @since 4.3.2 |
|
|
|
|
|
|
|
* @see AvailableSettings#MULTI_TENANT_IDENTIFIER_RESOLVER |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void setCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver currentTenantIdentifierResolver) { |
|
|
|
|
|
|
|
getProperties().put(AvailableSettings.MULTI_TENANT_IDENTIFIER_RESOLVER, currentTenantIdentifierResolver); |
|
|
|
|
|
|
|
super.setCurrentTenantIdentifierResolver(currentTenantIdentifierResolver); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Specify custom type filters for Spring-based scanning for entity classes. |
|
|
|
* Specify custom type filters for Spring-based scanning for entity classes. |
|
|
|
* <p>Default is to search all specified packages for classes annotated with |
|
|
|
* <p>Default is to search all specified packages for classes annotated with |
|
|
|
|