Hello,
I can't seem to get the order-by property to work on my one-to-many collection. I am using XDoclet to generate my mapping files. Here is the relevant portion of the mapping:
Code:
<set
name="tags"
lazy="true"
inverse="true"
cascade="delete"
sort="unsorted"
order-by="code asc"
>
<key
column="tag_type_id"
/>
<one-to-many
class="com.mrs.multiview.persistent.Tag"
/>
</set>
And here is the generated query when I initialize the associated collection:
Code:
2003-11-14 11:02:15,915 INFO [STDOUT] Hibernate: select tags0_.tag_id as tag_id__, tags0_.tag_id as tag_id, tags0_.code as code, tags0_.is_active as is_active, tags0_.time as time, tags0_.tag_type_id as tag_type5_ from tags tags0_ where tags0_.tag_type_id=?
I am using Hibernate 2.1beta4 (also tried 2.0, but still no luck) with MySQL database.
Am I doing something wrong in the mapping?
Thanks!