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.
SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle