-->
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: Using system properties in xml configuration files.
PostPosted: Fri Jan 28, 2005 3:01 pm 
Newbie

Joined: Fri Oct 22, 2004 10:55 am
Posts: 17
I was wondering if there is any way to have a place holder in configuration or mapping file which would be replace with the system property at runtime.

E.g:
If there is a line below in configuration or property file
<property name="database.password" value="${database.password}"/>
then ${database.password} should be replace with the system property.

(This approach is used by spring and we use to keep all the environment related stuff in system property so that we do not have to change the configuration file for different environments.)

If above factility is not available what would be the best approach to accomplish it. I was thinking of reading the xml file, manipulating it myself to replace the system property, create the dom and supply it to Configuation.configure(dom).

We also have lot of mapping files with following.

<component name="auditInfo" class="AuditInfo">
<property name="userAddId" type="string" column="USER_ADD_ID"/>
<property name="processAddId" type="string" column="PROCESS_ADD_ID"/>
<property name="userUpdateId" type="string" column="USER_UPDATE_ID"/>
<property name="userAddId" type="string" column="PROCESS_UPDATE_ID"/>
<property name="addDate" type="timestamp" column="STAMP_ADD_DTM"/>
<property name="updateDate" type="timestamp" column="STAMP_UPDATE_DTM"/>
</component>

Is there any way to avoid putting it in each file.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 28, 2005 4:32 pm 
Newbie

Joined: Fri Oct 22, 2004 10:55 am
Posts: 17
I am trying to accomplished the above in hibernate 2.1.6.


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.