Please explain how does getcurrentsession() method works in hibernate sessionfactory?
getCurrentSession() obtains the current session. The "current session" refers to a Hibernate Session bound by Hibernate behind the scenes, to the transaction scope.
To know more, read about getCurrentSession() method in Hibernate sessionfactory
Also you can read about Hibernate 4