ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane Bailliez <sbaill...@gmail.com>
Subject Re: Problem with groupBy / resultMap in release 2.3 (and 2.2) - worked in 2.1.7
Date Fri, 09 Feb 2007 16:12:49 GMT
Tim.Hammar@mcnichols.com wrote:
> Greetings all,
> I have a complex query whose result set is mapped to resultMaps several 
> levels deep by using the groupBy / resultMap feature.  This "grouping" 
>  works in 2.1.7 but fails in 2.2 and 2.3 when it encounters a resultMap 
> that contains 2 result elements that are themselves mapped to 
> resultMaps.  We had written several stored procedure queries using the 
> wonderful new multiple result set feature but had to roll back to 2.1.7 
> when regression testing failed on the complex nested queries.  There is 
> no exception raised but the repeating property is not grouped for these 
> elements.
> Has anyone else encountered this?
> I will post the query and result mapping if necessary but it is quite 
> lengthy.

I was fighting the same type of problems yesterday. Posted a mail 
through gmane but it still did not make it:

I actually forgot to say that it was, if I have time will try 
on 2.1.7-597

Hi all,

I'm trying to use nested resultMap with groupBy and seem something weird 

1) I need to specify the namespace within the child resultMap. Even 
though namespaces are off.

-- Person.xml is something like:
<sqlMap namespace="Person">
<resultMap id="personResult" class="person" groupBy="id">
   <result property="id" column="id"/>
   <result property="roles" resultMap="Person.roleResult"/>

<resultMap id="roleResult" class="role">
   <result property="role" column="authority"/>

2) While it works for a queryForObject, the mapping fails totally with a 
queryForList within the bean probe trying to map a String (the role) to 
the setRoles(List). I might be doing something wrong here so I will 
continue investigate and write a full simplified testcase time 
permitted, for now fallback mode is n+1 select... eeek.


View raw message