The moose likes Object Relational Mapping and the fly likes use of configure() method in Hibernate? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "use of configure() method in Hibernate?" Watch "use of configure() method in Hibernate?" New topic
Author

use of configure() method in Hibernate?

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8457

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!


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8457

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

Joined: Apr 14, 2004
Posts: 10336

The best place to find that out is to look at the JavaDocs. As you will see there are five configure methods.
 
 
subject: use of configure() method in Hibernate?
 
Threads others viewed
JDDIRealm and Active Directory
Hibernate configuration
configuration
Configure multiple actions (multiple submits) in a single JSP using Struts 2
hibernate.properties vs hibernate.cfg.xml
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture