-->
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: externalize schema names
PostPosted: Thu May 10, 2007 6:47 am 
Newbie

Joined: Thu May 03, 2007 12:04 pm
Posts: 2
Hi everybody,
Does any one have an idea how to externalize schema names for entities.
I give an example :

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class name="com.model.entity.EntityTest" table="TEST" schema="TEST">
<id name="code" type="string">
<column name="CODE" length="3" />
<generator class="assigned" />
</id>
<property name="label" type="string">
<column name="LABEL" length="20" not-null="true" />
</property>

</class>
</hibernate-mapping>

if schema names in the target database change the appilcation wont work.
My question is :
is there a mean to decalre this schema in one file and reference the decalred name in all hbm files ,so if i want to change the schema name ,i only have to do that in the config file.
Hope i a was clear.

Many thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 10, 2007 7:33 am 
Regular
Regular

Joined: Mon Mar 26, 2007 12:38 am
Posts: 119
Hi,
<property name="hibernate.default_schema">TEST</property>
in hibernate.cfg.xml
http://www.hibernate.org/hib_docs/v3/re ... ation.html


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 10, 2007 9:35 am 
Newbie

Joined: Thu May 03, 2007 12:04 pm
Posts: 2
Thank you for your reply,

I think the solution you give can be applied only if you work on a single schema. In my case i'm working on many schema's.so how to declare them all.
May be I'm wrong .
Thanks .


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.