Fix for Hibernate SessionFactory buildSessionFactory deprecation as of Hibernate 4.0
private static SessionFactory sessionFactory;
private static ServiceRegistry serviceRegistry;
private static SessionFactory configureSessionFactory() throws HibernateException {
Configuration configuration = new Configuration();
configuration.configure();
serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();
sessionFactory = configuration.buildSessionFactory(serviceRegistry);
return sessionFactory;
}
Such a nice Blog, thanks for sharing such important info about Industrial gases supplier .Keep learning Keep loving.
ReplyDelete