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.  [ 5 posts ] 
Author Message
 Post subject: Externalizing the schema name from mapping files?
PostPosted: Tue Nov 25, 2008 1:32 pm 
Newbie

Joined: Tue Nov 25, 2008 12:39 pm
Posts: 3
I am currently working with a customer who wants to have multiple setts of same tables in different schemas and to be able to pass the schema name to the mapping files through some configuration or properties file. Does Hibernate support this kind of functionality?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2008 3:36 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
There is an "hibernate.default_schema" option that can be set in either hibernate.properties or hibernate.cfg.xml. I have never used so I can't say if it works in your case or not. For more info see: http://www.hibernate.org/hib_docs/v3/re ... ional.html


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2008 3:50 pm 
Newbie

Joined: Tue Nov 25, 2008 12:39 pm
Posts: 3
Hi nordborg,
Thank you very much for your suggestion.
I have not tried it yet, but it looks very logical and applicable to my case.
I will try it shortly and will update this thread with the results.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2008 5:45 pm 
Newbie

Joined: Tue Nov 25, 2008 12:39 pm
Posts: 3
Tested the solution and it works fine.
Thanks again.


Top
 Profile  
 
 Post subject: Re: Externalizing the schema name from mapping files?
PostPosted: Tue Jun 09, 2009 1:57 pm 
Newbie

Joined: Tue Jun 09, 2009 1:53 pm
Posts: 1
Can you tell in details how you did it? I have similar situation. Multiple schema (diff environments) that have same tables but I somehow I want to pass the schema as an argument in command-line.

Or if that cant work then I can go with the properties file, as last option but even that I do not know. Thanks for replying! :)


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