-->
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.  [ 6 posts ] 
Author Message
 Post subject: How to get only one .hbm.xml file with XDOCLET?
PostPosted: Wed Sep 24, 2003 5:54 pm 
Newbie

Joined: Wed Sep 24, 2003 5:47 pm
Posts: 1
Hi all,

I'm trying to use xdoclet with hibernate, and I woud like to have one single .hbm.xml file, instead of one file per class. For instance, I prefer:

myapp.hbm.xml

instead of

Customer.hbm.xml
Purchase.hbm.xml
...

The reason is becuase in my JBOSS configuration, i have

<attribute name="MapResources">mappings/myapp.hbm.xml</attribute>

I have tried with wildcards, *.hbm.xml, but it does not work.

So how can I configure XDOCLET to merge all the hbm.xml definitions in one single file?

Regards
Diego


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2003 8:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Instead of trying to merge you could choose to allow XDoclet to generate the mapping descriptor for you. Use the JBoss sub-task.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 11, 2003 6:37 am 
Newbie

Joined: Sat Oct 11, 2003 6:34 am
Posts: 9
Hello,

david wrote:
Use the JBoss sub-task.


Someone can tell my, where i can find this "JBoss sub-task"?

Thanks,
Jaraz


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 11, 2003 7:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Check the XDoclet documentation.
http://xdoclet.sourceforge.net/ant/xdoclet/modules/hibernate/JBossServiceSubTask.html


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 11, 2003 8:25 am 
Newbie

Joined: Sat Oct 11, 2003 6:34 am
Posts: 9
Sorry,

i think i misunderstood something.

I use hibernate with Oracle, xdoclet, Struts and Tomcat.
How can i load the files xdoclet create for every Class into a Session Factory?
With this Struts Plugin Example i create a SessionFactory and Register it to the ServletContext.
http://www.hibernate.org/105.html

But at this Moment i have to update the mapping resource tags in hibernate.cfg.xml by hand.

<hibernate-configuration>
<session-factory>
<property...

<!-- Mapping files -->
<mapping resource="/BaseObject.hbm.xml"/> //Added by myself
<mapping resource="/SampleObject.hbm.xml"/> //Added by myself
....
</session-factory>

</hibernate-configuration>

I there a way to do this automatic?

Jaraz


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 11, 2003 10:53 am 
Newbie

Joined: Sat Oct 11, 2003 6:34 am
Posts: 9
OK, ich find a Solution.

Ant generates a jar file including my **.hbm.xml files and with Configuration.addJar(...) i load it into my SessionFactory.

Jaraz


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