-->
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: Configuring hmb.xml generation
PostPosted: Mon Sep 12, 2005 7:15 pm 
Newbie

Joined: Thu Sep 08, 2005 12:07 pm
Posts: 6
Hello,
I am using Hibernate Tools 3.1.0 alpha 5 in Eclipse 3.1.0 and have successfully reverse engineered my db into mapping files and pojos. (very cool stuff)

However, I am forced to edit the mapping files slightly because:
1: they conatain <generator class="assign" > for fields that are 'serial' primary keys (PostgreSQL 8.0). I would like them to be "identity"

2: for the 'one-to-many' associations, there is no 'cascade' attribute in the <set> element. For hibernate to correctly save the set of associated types, I am adding cascade="all-delete-orphan"

My question is: Is there a way to configure hibernate so the hbm.xml files that are created do not have to be edited?

Thanks in advance for any suggestions.

_________________
Eric Hansen


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 12, 2005 7:43 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
Check out the stuff on reverse engineering http://www.hibernate.org/hib_docs/tools/ant/index.html#gen10 . If you don't find it there, you have just found a great reason to use XSLT ;-)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 12, 2005 8:11 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
Max, if H Tools had a sort of second-pass-transformation feature, do you think anyone would use it?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 3:10 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well we have it implicitly today (jtidy runs on the xml), so if we could make the general available (need to collect the generated files etc.) it might be ok...but don't know if it really is going to be used...

btw. this is solved now in the current cvs version - here you can specify the generator and parameters per table.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 14, 2005 11:41 am 
Newbie

Joined: Thu Sep 08, 2005 12:07 pm
Posts: 6
max wrote:
btw. this is solved now in the current cvs version - here you can specify the generator and parameters per table.


Would I specify these in the hibernate.reveng.xml file? Could you point me to an example of the configuration?

Thanks!

_________________
Eric Hansen


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 14, 2005 12:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
currently only in cvs - there is some junit tests with reveng.xml

_________________
Max
Don't forget to rate


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.