Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Multi-tenancy using shared tables

Hi Theo,

Yes, EclipseLink's multitenant supports adding and removing tenants at runtime. You are not restricted by the persistence.xml file. Below are a few links that describe our support and usage further. In a nutshell you decorate your multitenant entities with @Multitenant and @TenantDiscriminatorColumns (optional) and can provide tenant id's at the Persistence unit, entity manager factor or entity manager level based on your requirements/needs.

http://wiki.eclipse.org/EclipseLink/Examples/JPA/Multitenant#Persistence_Usage_for_Multiple_Tenants

http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Single-Table_Multi-Tenancy

As for @Unique, I'm not aware of this annotation and its usage in EclipseLink's multitenant solution. Where did you see this used?

Cheers,
Guy


On 23/07/2011 11:21 AM, Theodor Richard wrote:
Hi,

I want to convert my current Java EE 6 app to support multi-tenancy. At first, I was gonna do it "manually" by adding a tenant-id into every entity and include it in the every query. But then, I came across EclipseLink's support for multi-tenancy. 

My question: I want to be able to add/remove tenants at runtime. I don't need any tenant-specific customization. Does EclipseLink support this? And how does @Unique behave? Is it restricted to one tenant or does it apply across all tenants? I watched the screencast and read the wiki about Multi-tenancy. It looks like you can only add tenants at deployment time (by changing the persistence XML file)

Thanks,
Theo


_______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Back to the top