-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Hibernate Start
PostPosted: Thu Mar 04, 2004 4:05 pm 
Newbie

Joined: Thu Mar 04, 2004 3:55 pm
Posts: 8
Hi,

To obtain a SessionFactory, I need this code:
Configuration cfg = new Configuration()
.addClass(Customer.class)
.addClass(Order.class)
.addClass(????.class);
SessionFactory sessions = cfg.buildSessionFactory();

If my application has 200 tables,
won't the execution of the code above be very slow?

Excuse my english...

Thanks,

Douglas
Lages/SC - Brazil


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 04, 2004 4:20 pm 
Beginner
Beginner

Joined: Tue Jan 27, 2004 2:14 pm
Posts: 40
Location: Atlanta, GA, USA
Yes, it will take a while, but you should only do this once on start up. You might want to consider using the hibernate config xml file for this.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 04, 2004 4:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
The sessionfactory is usually a singleton.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 04, 2004 5:11 pm 
Newbie

Joined: Thu Mar 04, 2004 3:55 pm
Posts: 8
Even so. For my estimates, my application will take of 1 to 2 minutes to be started.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.