Add Example for Multi Tenancy using Parent-Child relationship
bashayam30 opened this issue · 1 comments
I am trying to implement multi tenancy by following the post - https://spring.io/blog/2022/07/31/how-to-integrate-hibernates-multitenant-feature-with-spring-data-jpa-in-a-spring-boot-application
But while using parent child relationship with @onetomany relation and LAZY fetch, tenantId filter is not applied by hibernate to the SQL JOIN queries to fetch the child records.
Need an example on how to apply tenantId filter for Partitioned Data approach.
Thanks in advance!
Multitenancy is implemented by Hibernate. Spring (Data) just provides some integration for that. What you describe seems therefore to be a problem with Hibernate. Please open an issue with the Hibernate team when you think this is a bug or if you think it should work and you just need help with this you may ask on Stackoverflow, I guess.