i ve read the Hibernate documenation for multitenancy (HERE) several times as well as many other threads.
What i have: I have a working application, which serves data (e.g. Products) via rest-service.
MYSQL(5.6) -> HIBERNATE(4.3.7 FINAL) -> SPRING DATA JPA (1.7.1) -> SPRING MVC (4.1.4) -> REST (jackson -> json)
Everything works fine (CRUD)
I have multiple tables in my application (customers, customer_interest, products, product_tags, ...).
why am i asking:
i want to add multi-tenancy -> for each tenant, there should be own tables (tenantA_customers, tenantA_products, ...) but the same "template" should always be used (-> customer has the same attributes for every tenant)
So my questions are:
1) How does the SCHEMA-APPROACH from hibernate works exactly?
2) So does it work with multible tables?
Addition information/Question:
- There wont be that many tenants ( < 50 for sure)
The MultiTenantConnectionProvider example confuses me a bit, because it adds the "use" statement, i thought it is to "use" a database? SRC: (example impl ,"This approach is only relevant to the SCHEMA approach.")
Thanks for your help in advance. Please let me know if something is unclrear