• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

use of configure() method in Hibernate?

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

What is the use of configure() method in the Configuration class? Also what it means by saying Configuration cfg = new Configuration()? Please explain guys!
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is instantiating a new Configuration. A Configuration represents a set of mappings between object and database. The configure methods allow different way to define the Configuration, either by using Hibernate default lookup strategy (finding hibernate.cfg.xml in the classpath) or explicitly definig it some other way.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The configure() method is overloaded right...one with no args and the other with String args that take a hibernate mapping file as argument?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best place to find that out is to look at the JavaDocs. As you will see there are five configure methods.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic