How to integrate Hibernates Multitenant feature with Spring Data JPA in a Spring Boot application
For quite some time now, Hibernate has offered a Multitenant feature. It integrates nicely with Spring, but there is not much information about how to actually set it up, so I thought an example or two or three could help.
There is already an excellent blog article, but it is a little dated and it covers a lot of specifics to the business problems the author tried to solve. This approach hides a little of the actual integration, which will be the focus of this article.
Do not worry about the code in this post. You can find links to the full code examples at the end of this blog post.