I’m interested to use my Java+Struts+Spring+EclipseLink application with multitenancy, I did some examples to provide multitenancy and everthing was ok.
But…
I have a equirement that could be possible this situation:
-
Tenants A,B,C with isolated data and shared schema and using single table.
-
Tenant A and B can see also data from Tenant C. But Tenant C can see just its own data as multitenancy works normally.
A real example could be a company with differents deparments using my application but some departments can see other data.
For insert data I think I can manage my code with @Multitenant(MultitenantType.SINGLE_TABLE) but I dont’t know if the part of filter data is possible to be managed with eclipseLink or what solution I can use.
You may want to have a different persistence unit for each tenant, and provide different configuration for each.
You could also not use @Multitenant but use @AdditionalCriteria instead, or application logic.