SessionFactory



SessionFactory (org.hibernate.SessionFactory) is an Interface
A thread-safe, immutable cache of compiled mappings for a single database.
A factory for org.hibernate.Session instances Optionally maintains a second level cache of data

SessionFactory sesssionFactoryObj = configurationObj.buildSessionFactory();

Actually SessionFactory is an interface not a class, and SessionFactoryImpl is the class which has implimented SessionFactory interface , so we are internally creating object of SessionFactoryImpl class and storing in the interface reference, so this SessionFactory object sesssionFactoryObj contains all the data regarding the configuation file so we can call sesssionFactoryObj as heavy weight object.