Java Coder
Is buildSessionFactory() deprecated in hibernate 4?
2 Answer(s)      a year and 7 months ago
Posted in : Hibernate

Hi,

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?

Thanks

Advertisement
View Answers

January 27, 2014 at 4:45 PM


Hi,

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.

Thanks



January 27, 2014 at 4:48 PM


Hi,

Please check the tutorial:

Hibernate 4 create Session Factory: Example of creating Session Factory in Hibernate 4.

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:

Thanks










Related Tutorials/Questions & Answers: