Home  >  Forum  >  Hibernate
Post New Query

How to build SessionFactory in Hibernate 4


joined on
August 11,2014
Asked on October 29,2014
Hi All,

I have started to learn hibernate 4. I searched for hibernate 4 new features and got that we can build SessionFactory in different way.
Does anyone provide better example?

 
joined on
October 10,2013
Replied on October 29,2014

You can build SessionFactory in hibernate 4 using StandardServiceRegistryBuilder.

 Configuration configuration = new Configuration().configure();
 StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties());
 sessionFactory = configuration.buildSessionFactory(builder.build());

Write Answer









Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us