ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Maves" <nathan.ma...@gmail.com>
Subject Re: Wrong sorting when using orderBy clause
Date Sun, 14 Dec 2008 15:22:01 GMT
What is the result class?  I have a feeling that you might be trying
to user a map which by default insertion order it not retained.

On Sun, Dec 14, 2008 at 7:33 AM, Corrado Alesso <co.alesso@fastwebnet.it> wrote:
> Hello everyone, I'm facing a problem with iBatis.
>
> I guess this is a known problem, but after a couple of hours looking for a
> solution with no luck, I have to write here...
>
> I have an entity that has a complex colletion as a property. So I perform a
> query with a join, and I use the 'groupBy' clause with the ResultMap.
> Everything is working fine, and the complex property is populated with all
> the objects.
>
> The problem is that I've put an 'order by' clause in the query, and this
> ordering is not respected by iBatis. I mean, when I access the complex
> property (which is a List of objects) it is not ordered the same way.
>
> For example, when I execute the query in the console I get:
>
> id  user  tag
> 4   u1    graphic
> 4   u1    layout
> 4   u1    website
>
> (the query has an 'order by' on 'tag')
>
> When I iterate the complex property tag of my Java object I get:
>
> website
> layout
> graphic
>
>
> Any idea or keyword I should search for?
>
> Thank you
>
> Corrado
>

Mime
View raw message