-->
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.  [ 1 post ] 
Author Message
 Post subject: Set order-by does not order correctly
PostPosted: Wed Jul 28, 2004 7:51 am 
Senior
Senior

Joined: Fri Jun 18, 2004 10:17 am
Posts: 140
Hi,

I'm finding that my Set collections are not being ordered in respect of the order-by attribute value I specify for them.

Here is an example of 5 collection items that I added sequentially today - note the bad ordering. I added test first and test 5 last.

Code:
28/07/2004 false test 4
28/07/2004 true test 2
28/07/2004 false test 5
28/07/2004 false test 3
28/07/2004 false test


The Set element attributes are defined as

Code:
<set name="updates" inverse="true" order-by="created desc" lazy="true" cascade="all">


Here I try to sort on the created date (I have also tried the id but the same incorrect ordering was output).

I notice in the hibernate logging that the created date has full date and time to the second, so there should be no reason the ordering fails. I have confirmed the ordering is fine using a sql query on the database also.

I am running JDK 1.4.2_04 so the order-by attribute I assume should be ok. This is Hibernate 2.1.

Thanks for your consideration.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.