Java – Hibernate – Deprecated: buildSessionFactory

Deprecated

SessionFactory sf = new Configuration().configure().buildSessionFactory();

 

Aktuell

Configuration configuration = new Configuration();
configuration.configure("hibernate.cfg.xml");
StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties());
SessionFactory sf = configuration.buildSessionFactory(ssrb.build());
Session session = sf.openSession();

Getestet mit hibernate-core-4.3.1.Final.jar
 

Ein Gedanke zu „Java – Hibernate – Deprecated: buildSessionFactory

Schreibe einen Kommentar