Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate basic

 
vendikonda sravan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to Hibernate and i want Exactly happing in the fallowing code please explain step by step,

// This step will read hibernate.cfg.xml and prepare hibernate for use

SessionFactory sessionFactory = new

Configuration().configure().buildSessionFactory();
session =sessionFactory.openSession();

I do know what is a config file .
just wan a know why these specific steps for reading config file.

Thanks
Sravan V
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A configuration file is used to configure your SessionFactory (the SessionFactory is the object through which Hibernate abstracts data access). See this helpful resource.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!