The application obtains session object from SessionFactory interface. Typically there should be only one sessionFacory for whole application and is loaded during application initialization. The SessionFactory caches generate SQL Statement and other mapping metadata that Hibernate use at runtime. It also hold cached data that has been read in one unit of work and can be reused in a future unit of work.
You can get the instance of SessionFactory by the configuration object as below
SessionFactory sessionFactory = configuration.buildSessionFactory();