-->
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.  [ 5 posts ] 
Author Message
 Post subject: order-by in <set name=""> in mapping not wor
PostPosted: Thu Mar 05, 2009 3:31 am 
Newbie

Joined: Thu Mar 05, 2009 2:58 am
Posts: 4
Hibernate version: 3.0.5

In my.hbm file I am fetching a table as a set

<set name="someSet" table="someTable" lazy="false" inverse="true"
order-by="columnName desc" cascade="all-delete-orphan">
<key>
....
</key>
<one-to-many class="package.className" />
</set>

The order-by clause is not working

What could be the reason?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 05, 2009 3:39 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
What do you mean with not working? Is there no order by in the sql string or is the collection not ordered? If you provide some more code, we can maybe help.

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 05, 2009 3:44 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
What do you mean with not working? Is there no order by in the sql string or is the collection not ordered? If you provide some more code, we can maybe help.

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 05, 2009 4:50 am 
Newbie

Joined: Thu Mar 05, 2009 2:58 am
Posts: 4
When I add the attribute order-by in the .hbm file, I expected the list of records that is fetched from database to be sorted on that column in DESC order.

But that did not happen.
What could be the reason?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 05, 2009 10:05 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
Could you provide some more information like code or mapping?

_________________
-----------------
Need advanced help? http://www.viada.eu


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