-->
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: HBM files directory and dynamic HBMs
PostPosted: Wed Oct 01, 2003 8:14 am 
Newbie

Joined: Wed Oct 01, 2003 7:59 am
Posts: 2
Hello:
-->In Hibernate, when we create mapping files (*.HBM.XML), normally they must bo localized in directorie where are their respectives classes (like bin/package1/package2/). How can I change this? Or how do I say that mapping files are in a other directory (like conf/hibernate/)?

-->In my Project I have this mapping file:
Code:
<hibernate-mapping>
<class name="package1.package2.Bean" table="tb_beanXXX" >
<!-- ... -->
</class>
</hibernate-mapping>

Well, after read my mapping file I want change "table" attribute from "class" to substitute "XXX" substring for another String. It will be a dynamic mapping. Does someone have any idea?

Thanks,

_________________
Rafael Ubiratam Clemente Afonso
rafael.afonso@javafree.com.br
JavaFree.com.br
Se


Top
 Profile  
 
 Post subject: I also need the function
PostPosted: Sat Dec 06, 2003 7:46 am 
Newbie

Joined: Sat Dec 06, 2003 7:21 am
Posts: 4
up..

I also need the function


Top
 Profile  
 
 Post subject: Re: HBM files directory and dynamic HBMs
PostPosted: Sat Dec 06, 2003 8:11 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
rafonso wrote:
-->In Hibernate, when we create mapping files (*.HBM.XML), normally they must bo localized in directorie where are their respectives classes (like bin/package1/package2/). How can I change this? Or how do I say that mapping files are in a other directory (like conf/hibernate/)?

As long as conf/hibernate is in your CP, you can do
Code:
configuration.addFile("/not/my/package/notMyClassName.hbm.xml);

In 2.1 you can also do
Code:
configuration.addDirectory(File dir);


rafonso wrote:
Well, after read my mapping file I want change "table" attribute from "class" to substitute "XXX" substring for another String. It will be a dynamic mapping. Does someone have any idea?

Load the files by yourself putting it in a DOM, do your expansion and give it to Hibernate
Code:
configuration.addDocument(myExpandedDOM);

_________________
Emmanuel


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.