-->
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.  [ 4 posts ] 
Author Message
 Post subject: setting ORDER-BY on a one-to-many relationship in reveng.xml
PostPosted: Thu Sep 18, 2008 5:03 am 
Newbie

Joined: Thu Sep 18, 2008 4:53 am
Posts: 5
Hi

Well my question is pretty much stated in the subject. In the first place I modified my generated hbm.xml file by hand to apply the ordering I wanted on a given set. But then after accidentally re-launching Hibernate Tools, the file got overwritten (which makes sense) and I realized it probably was not best practice to do so.

However I couldn't find how to define this kind of setting in reveng.xml, can anyone help?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 18, 2008 9:21 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
As a property in your Set:

Code:
<set name="contactSet" inverse="true" lazy="true"
       order-by="LAST_NAME asc" >

_________________
Gonzalo Díaz


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 19, 2008 2:26 am 
Newbie

Joined: Thu Sep 18, 2008 4:53 am
Posts: 5
Thanks for your answer. This is exactly what I did in my generated hbm.xml file. However my question is, is there a way to tell Hibernate Tools to automatically add this property when it generates that file, so that I don't need to modify it by hand after generation, and so that my change doesn't get overwritten whenever I need to re-generate the hbm's?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 19, 2008 7:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
currently there is no direct api for this (we don't expose *all* properties in reveng.xml since then it would be a hbm.xml file ;)

But you can adjust the .ftl templates to do whatever you want generated.

_________________
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.  [ 4 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.