I want to convert my application to support multi-tenancy using shared tables (i.e. every table gets a tenant id). Obviously, I would not be able to use @Column(unique = true) any more, because it would enforce uniqueness across all tenants, which I don’t want.
I’m using Glassfish 3.1.1 with EclipseLink. Is there a way make @Column(unique = true) force uniqueness per tenant (rather than per table). Or do I have to enforce this in the business logic?
It is also possible to specify uniqueness constraint on then
@Tableannotation, e.g.