I am trying to Create the SessionFactory in Hibernate using following code:
Configuration configuration = new Configuration(); configuration.configure(); serviceRegistry = new ServiceRegistryBuilder().applySettings( configuration.getProperties()).buildServiceRegistry(); sessionFactory = configuration.buildSessionFactory(serviceRegistry);
It's giving the following error:
The type ServiceRegistryBuilder is deprecated
What is the correct way of creating the SessionFactory in Hibernate 4.3 release.
Many API's are depricated in the Hibernate 4.3.x and the way of creating the SessionFactory is also changed.
So, you should use the latest way of creating the SessionFactory.