-->
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: order-by in bag - many-to-many collection
PostPosted: Fri Nov 19, 2010 8:55 am 
Newbie

Joined: Tue Aug 28, 2007 2:22 pm
Posts: 7
I can not order this bag because the SQL query is poorly constructed (the column order-by is in the second table).
I have dealt with this problem in versions v2.1, v2.1.2 and 3beta.
Has this been resolved, and I did not know? Or is there something else I should do?

In this case, please note that "the select expression" has the correct columns, but "the order-by expression" does.

select: documento1_.indice as indice10_0_
order by: documentos0_.indice

Code:
the mapping:
<bag name="Documentos" table="[dbo].[OperCapac_Aplicaciones_Segun_Seccion]"
  cascade="save-update" inverse="true" lazy="true" order-by="indice">
<key column="c_seccion"/>
<many-to-many class="Documento" column="id_manual"/>
</bag>

the exception
could not initialize a collection: [OC.orm.Seccion.Documentos#CDB][SQL:
SELECT    documentos0_.c_seccion   as c2_1_,
          documentos0_.id_manual   as id1_1_,
          documento1_.id_manual    as id1_10_0_,
          ...
          documento1_.indice       as indice10_0_
FROM      [dbo].[documentos_secciones] documentos0_
          left outer join [dbo].[documentos] documento1_
              on documentos0_.id_manual=documento1_.id_manual
WHERE     documentos0_.c_seccion=?
ORDER BY  documentos0_.indice
]


thanks!


Top
 Profile  
 
 Post subject: Re: order-by in bag - many-to-many collection
PostPosted: Thu Dec 02, 2010 11:37 am 
Newbie

Joined: Tue Aug 28, 2007 2:22 pm
Posts: 7
comments?


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.