-->
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.  [ 7 posts ] 
Author Message
 Post subject: Hbm2HbmXml help needed. Please help! Very important
PostPosted: Tue Mar 04, 2008 8:37 am 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
I have table A, table B. I use hbm2hbmxml tool to generate mapping xml files. I get 2 hbm files namely A.hbm.xml and B.hbm.xml. Now my requirement is to create a single hbm file by name AB.hbm.xml instead of two hbm files. Is there a possibility. If yes, can someone please tell me how it can be done. I have 250 tables and I don't want 250 mapping files to be created. Please reply!!!

_________________
Sukirtha


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 04, 2008 3:20 pm 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
You can have more than class mapping in single <hibernate-mapping> node. Refer to http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd for syntax. Different hibernate mapping files are created for readability purpose.

Code:
<hibernate-mapping>
  <class name="A" table="tblA">
  <!--class A mapping comes here-->
</class>
  <class name="B" table="tblB">
  <!--class B mapping comes here-->
</class>
</hibernate-mapping


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 04, 2008 11:56 pm 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
Thank you sjhyam. But I want to do this while using <hbm2hbmxml> tool. This tool by default generates multiple hbm file. Is there a way to tell the tool to generate the mappings in a single mapping file?

_________________
Sukirtha


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 05, 2008 12:03 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
No. you could do some xml transformation on the generated files if you feel like it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 05, 2008 12:18 am 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
Thanks Max. In that case Ill handle it in java.

Max, can you please tell me which .ftl file calls the set.hbm.ftl include. I want to tweek the file that call the <set> creation part.

_________________
Sukirtha


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 05, 2008 2:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I don't have it on this computer (a phone) to verify, but hibernate-tools.jar/hbm/set.hbm.ftl would be my first guess.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 06, 2008 1:03 am 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
But set.hbm.ftl creates the set tag. I want the .ftl file that invokes the set.hbm.ftl file.

_________________
Sukirtha


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