| I like that initial plan. Just the @TenantDiscriminatorColumn annotation. I'd say add a parameter to it for the param/literal option and have it default to param. Even though it risks more verbose configuration - we can later change the default on a per-SessionFactory basis - it gives finer grained control upfront and that's a good thing. For example, suppose only one table is big enough that it ends up being partitioned (assuming also that it is partitioned by tenant) then only that entity would need the "literal" setting for it's tenant discriminator. I think that keeps it simple and covers the most use cases at the same time. |