问题描述
我尝试使用单独的模式方法将多租户添加到Java应用程序中,如。
I am trying to add multi tenancy to a java application using the separate schema approach as outlined in this webinar
I wanted to know how would i configure mulitple datasources via spring perhaps by using properties files and get the datasources from the spring context based on tenant id.
More importantly though i want to be able to configure my custom connection provider implementation that supports this multi-tenancy feature to be used by hibernate instead of the injectedconnectionprovider that it uses by default.
How can i achieve this.
Use the AbstractRoutingDataSource
. See my answer located @ Multiple Entity Manager issue in Spring when using more than one datasource.
这篇关于Hibernate中的多租户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!