| ah so deso. Actually for that "tougher" part I think of two approaches: the excluded-by-default vs the included-by-default. AKA, the non-multi-tenant-by-default vs the multi-tenant-by-default. In the first approach no @Entity is enabled for discriminator-base multi-tenant treatment by default. One must explicitly enable it for an entity. Perhaps via a new @Tenant or similar annotation. The second approach is the reverse: one enables multi-tenancy for the persistence unit and can indicate entities which do not get that treatment. A third would be to have different persistence units, but I think that is too inflexible. Personally, I'd go with the first approach: enable it IFF the entity has the @Tenant (or similar) annotation. The downside is just that you have to do this for each entity (though we could support inheritance). Basically: if the feature works, a bit of setup via denoting which entities to treat this way seems like a small hurdle. Thoughts? |