Hi,
Hibernate 1.2.5
When I map a many-to-many collection and decide to order this collection with the "order-by" clause, then the generarted query shows the order-by on the joining table
eg:
<set
role="services"
table="relations_forfaits_services"
cascade="none"
order-by="nom"
>
<key column="forfait_id"/>
<many-to-many
class="com.model.offres.Service"
column="service_id"
/>
</set>
==>
Hibernate: SELECT relat0.service_id, Servi1.service_id AS service_id0_,Servi1.date_creation as date_creation0_, Servi1.date_modif as date_modif0_, Servi1.service_name as service_name0_, Servi1.service_description as service_description0_ FROM relations_forfaits_services relat0, services Servi1 WHERE relat0.forfait_id= ? AND relat0.service_id=Servi1.service_id(+) ORDER BY relat0.nom asc
any workaround ?
Thanks
Franck
|