Your implementation of CurrentTenantIdentifierResolver would need some source to extract the current tenant from. for example you could resolve it by accessing the current session from within the resolver, the userdetails of the authenticated user, using a servlet-filter to manually set the current tenant in each request or similar.
But there seems to be a non-trivial issue regarding the internal usage of the configured CurrentTenantIdenfierResolver: https://forum.hibernate.org/viewtopic.php?f=1&t=1014559
. I'm currently stuck at exactly this issue and I don't really like the idea to subclass SessionFactoryImpl. Does anybody have a hint how to solve this in a more elegant way?