-->
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: set schemaName via API
PostPosted: Thu Mar 25, 2004 10:35 am 
Newbie

Joined: Tue Mar 09, 2004 9:17 am
Posts: 12
Hi there,
i was searching the website/ forum/mailarchive and the api docs as well for a long time but still do not know how to set the SchemaName dynamically via API.

I have a oracle db and my tables are distributed over a set of schemas.
The schema attribute in my *.hbm.xml file is working well for oracle.

My problem is that since i make TTD i use HSQLDB for my development environment and HSQLDB does not support schema names. (So far i know).

The idea is to set schema name until i use oracel at production time and do not use any schema name until development time.
Since i do not use xdoclet is there a possibility to set/ remove the schema name via API?
In worst case i can create my *hbm.xml dynamically but i'm searching for a smarter solutopn.
Thanks for any hints.

Stefan


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 26, 2004 6:20 pm 
Newbie

Joined: Wed Mar 17, 2004 7:44 pm
Posts: 7
Location: Chicago Area, IL, US
I was also looking to answer this question, and found this yesterday: http://forum.hibernate.org/viewtopic.ph ... nge+schema

You can make a hibernate.cfg.xml for Oracle, and one for HSQLDB, and flip between them as necessary. In the config file that points to Oracle, put
Code:
<property name="default_schema">PROD</property>
and pull out all the references to schema name in your mapping xml files.

This will work if all the tables you want to hit are in the same schema. Otherwise, there is an API to call during runtime, but I didn't try that.


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.