I am trying to develop an application in Hibernate 4. I am using the Hibernate 4.3.0.final build. Following code is given is the Hibernate documentation:
SessionFactory sessions = cfg.buildSessionFactory();
But when I am using it in Hibernate 4 its giving error.
can anyone help me in finding the correct solution?
There is change in the Hibernate 4 API So, you have to use a little different code.
Check the thread Create sessionfactory in Hibernate 4.
Please check the tutorial:
In the above tutorial you will find the code to correctly create the SessionFactory.
Above tutorial is using Hibernate 4.3.0.final build.
Following are the tutorials of Hibernate: