I am new to Hibernate and I am trying to create a session manager. Here is the code to create an instance of SessionFactory :
Configuration configuration = new Configuration().configure(config); ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings( configuration.getProperties() ).buildServiceRegistry(); SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry); return sessionFactory;
When I run this in eclipse, I get the following compilation error: The method buildSessionFactory() in the type Configuration is not applicable for the arguments (ServiceRegistry).
Using the latest version of Hibernate, shouldn't buildSessionFactory accept the ServiceRegistry argument?
hakas source share