• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hb Configuration doubt

 
Rauhl Roy
Ranch Hand
Posts: 401
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



may i know what is happening in the above code.
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();


The above code does the following:
1- Instantiate a configuration object, which allows the application to specify properties and mapping documents.
2- Use the mapping and properties specified in a resource called 'hibernate.cfg.xml' to configure hibernate.
3- Instantiate a new SessionFactory using the the property file used in step 2.
4- Return a SessionFactory object, which is used to create database sessions, transactions, etc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic