-->
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.  [ 3 posts ] 
Author Message
 Post subject: Changing table names at runtime
PostPosted: Wed Apr 20, 2005 10:11 am 
Newbie

Joined: Sun Mar 28, 2004 7:31 pm
Posts: 1
We are looking for more ideas (using Hibernate 3 and Oracle) to point the same Hibernate persistent class at different copies of the same table at runtime depending on a context set within the application (new tables/contexts are dynamically configured for the application). We are considering one alternative of dynamically loading new configuration/session factories (with selected class definitions and context-specific table names in the configuration) on a per context basis. We also know that we can generate and use SQL queries to read access or use a custom persister. Modifying Hibernate is an alternative that we don't want to pursue.

Thanks
R


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 20, 2005 10:40 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Maybe try using your own persister class - with combination of your own naming startegy implementation.
Should do a heavy chack on this one though. :-(


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 20, 2005 1:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
have you tried to use different entity-names ?
<class entity-name="X1" class="X">
....

and X2, X3 etc....

that allows you to map the same class to multiple tables.

But if you just want to have different configurations/sessionfactories then some search and replace in the mapping files or some programmatic changes into a configuration should work fine.

_________________
Max
Don't forget to rate


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