Vaadin and Hibernate multi-tenancy

No problem! Lmk if I can help find something

Currently I put the tenant id in the Vaadin session

Yeah–there’s a servlet filter there that does the same thing

It uses schema-per-tenant so it selects the schema there

Can be easily adapted to any of the common tenancy-models

You can also declaratively include Vaadin components based on role or tenancy which comes from Aire

https://github.com/sunshower-io/groovv-core/blob/main/groovv/src/main/java/io/groovv/app/ui/components/annotations/UiDecorator.java

https://github.com/sunshower-io/groovv-core/blob/main/groovv/src/main/java/io/groovv/app/ui/views/admin/components/UserRegistrationListProvider.java so if the current role here is ROLE_ROOT then this component will be included at the path specified by @UiDecorator

otherwise it won’t be

You add the slots to layouts like this: https://github.com/sunshower-io/groovv-core/blob/main/groovv/src/main/java/io/groovv/app/ui/views/home/HomeView.java

One day I’ll get around to documenting this stuff =/

If you’d like we could try to add a new Maven archetype that could generate all of this structure; I have one deployed to maven central that allows you to generate Vaadin widget projects https://github.com/aire-ux/aire-archetype

Should be easy to extend