Home  >  Forum  >  Hibernate
Post New Query

How to build SessionFactory in Hibernate 4



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?

 



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






©2019 concretepage.com | Privacy Policy | Contact Us