To autowire Hibernate SessionFactory in the Spring Boot application, the SpringSessionContext - implementation of the Hibernate’s CurrentSessionContext interface - can be used.
1. Add entry in application.properties file
Specify spring.jpa.properties.hibernate.current_session_context_class property with SpringSessionContext class as the value.