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

Is 'Configuration' an Interface or Class in hibernate?

 
Kamal Saini
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have read in 'Hibernate in Action' book that 'Configuration' is an interface. But then below that I saw lines of code like :

Configuration cfg = new Configuration();
SessionFactory sessionFactory =
cfg.configure().buildSessionFactory();

Can someone clear my confusion:
If Configuration is an interface then how we can instantiate it like above code?
Or there are two things in Hibernate one is Configuration class and one is Configuration Interface?
 
Manuel Petermann
Ranch Hand
Posts: 177
Hibernate Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javadocs
Its a Class not an Interface.
Maybe it was an Interface in the past. Hibernate isnt very api compatible between versions.
 
Kamal Saini
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Manuel, For the clarification.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!