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.