Question: Create sessionfactory in Hibernate 4
How to create sessionfactory in Hibernate 4?
Hibernate 4 is the latest version of Hibernate. In this version of Hibernate there is many updates and API changes. Many earlier API's are deprecated and new API's are added to make the Hibernate suitable for the development and deployment of Enterprise application.
In the latest version of Hibernate e.g. Hibernate 4 the buildSessionFactory method is deprecated and new API is added.
You should use the new method buildSessionFactory() for building the SessionFactory object.
Check the tutorial Hibernate 4 create Session Factory: Example of creating Session Factory in Hibernate 4 for example usage and the fully running code.
Check the following tutorials:
Read latest Hibernate tutorials.