-->
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.  [ 2 posts ] 
Author Message
 Post subject: Is it possible to add new mapping to existing SessionFactory
PostPosted: Wed Dec 21, 2005 5:29 pm 
Beginner
Beginner

Joined: Mon Nov 15, 2004 8:32 pm
Posts: 36
Hi,
Is it possible to add new persistent classes to an existing SessionFactory? I know you can use the Configuration class to dynamically add mapping files before you create the SessionFactory, but once the SessionFactory is created, is it possible to add new mapping?
In our case, we have some persistent classes which our user may develop and we will load through a URL class loader dynamically to our running system. The mapping file will be generated on the fly. But we are not sure if it's possible to the new mapping files to the existing SessionFactory, or we have to create a new SessionFactory to load the new mapping files. The destroy/recreate of session factory seems to be a little bit expensive to us.

Thanks for your help.

--Jiunjiun

Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

[b]Hibernate version:[/b]

[b]Mapping documents:[/b]

[b]Code between sessionFactory.openSession() and session.close():[/b]

[b]Full stack trace of any exception that occurs:[/b]

[b]Name and version of the database you are using:[/b]

[b]The generated SQL (show_sql=true):[/b]

[b]Debug level Hibernate log excerpt:[/b]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 22, 2005 7:01 am 
Senior
Senior

Joined: Tue May 10, 2005 9:00 am
Posts: 125
There is no way i know of, neither any clue on API as the possibility to inject new classes in an existing SessionFactory. The best way is to reload a SessionFactory. You may perhaps reuse the existing Configuration object, but am not sure it will gain you much time , as most of work is done by SessionFactory creation.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.