Background : I am building a Multitenant SaaS app and have chosen single database, shared schema as the Multitenancy approach. Every table has a discriminat
I have blogged about Multi-tenant applications using Spring Boot, JPA, Hibernate and Postgres and even though I took the DB per tenant approach, the DISCRIMINATOR (One or multiple table columns used to specify different tenants) approach you are using most-likely requires less configuration.
Take a look at the CurrentTenantIdentifierResolver implementation (TenantDvdRentalIdentifierResolverImpl.java), the DvdRentalMultiTenantInterceptor.java Spring MVC interceptor and DvdRentalTenantContext.java that uses the ThreadLocal to store / pass the tenantId.