-->
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.  [ 2 posts ] 
Author Message
 Post subject: many-to-many and order-by
PostPosted: Mon Sep 08, 2003 3:10 pm 
Newbie

Joined: Mon Sep 08, 2003 3:04 pm
Posts: 12
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2003 6:13 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use a collection filter.

Or a sorted collection.


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