At the moment there is no way to provide bean reference for MultiTenantConnectionProvider. This is necessary because an implementation of MultiTentnatConnectionProvider needs to be wired to a DataSource. The current version of LocalSessionFactoryBuilder sets only the dataSource property to a bean reference. Since currently any implementation of MultiTenantConnectionProvider is not Spring managed, users are forced to define another DataSource/Connection Pool with hard coded db properties or a non Spring way of accessing those properties
Actually, just like "hibernate.tenant_identifier_resolver", the "hibernate.multi_tenant_connection_provider" property not only accepts a class name but also an instance. So you could pass in a MultiTenantConnectionProvider instance through a <map> specified against LocalSessionFactoryBean's "hibernateProperties", or call LocalSessionFactoryBuilder's getProperties().put(...) method accordingly.
That said, to make this first-class in Spring 4, I've added setMultiTenantConnectionProvider and setCurrentTenantIdentifierResolver methods to both LocalSessionFactoryBuilder and LocalSessionFactoryBean.
I was not aware of the method you have mentioned. Thank you! I have actually done the same thing you have described as a temporary fix. Extended LocalSessionFactoryBuilder and wrote duplicate LocalSessionFactoryBean with a tiny change to use the custom LocalSessionFactoryBuilder.
I tried following the suggest from @Juergen Hoeller with JPA but got an NPE (http://pastebin.com/E3RwNt1y). The config is - http://pastebin.com/ZNdkzkKT. It seems that the AbstractEntityManagerFactoryBean.getObject() is called before AbstractEntityManagerFactoryBean.afterPropertiesSet(). Any idea what could be wrong?