Vaadin and Hibernate multi-tenancy

Hi, does anybody have an example on how to use multi-tenancy with Vaadin and Hibernate ?

I see one example here

@nice-camel Thanks but it doesn’t use Vaadin. I’m interested when to set the tenant id in a Vaadin app

It depends a bit of how you want to implement the multi tenancy.

@faithful-emu the question is how do I set the current context in a Vaadin application. In case of a SPA the tenant Id would be set based on the request header.

I would store it in the Authentication managed by spring

Yeah that would be a good idea!

Only missing puzzle piece for me: how do you determine what user has what tenant id… or do you have a centralized authentication that returns the user + tenant id? That would make it easy

the tenant can be selected

after selection i would store in the authentication

Ahh! Perfect, that’s the easiest! Reminds me of the old days where people had to select “Domain” or “Realm” to login as third param on a Login form


Please write a blog on how you implemented this

Great idea!

I have an example as well

I can push this up to one of our OSS repos today

@adaptable-uakari here’s how it’s modeled:

Thanks! Will have a look