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_.indiceCode:
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!