Ok....the error starts with:

Exception in thread "main" org.springframework.jdbc.UncategorizedSQLException: 
SqlMapClient operation; uncategorized SQLException for SQL []; SQL state 
[null]; error code [0];   
--- The error occurred in test.xml.  
--- The error occurred while applying a result map.  
--- Check the a.  
--- Check the result mapping for the 'aa' property.  
--- Cause: java.sql.SQLException: Error: executeQueryForObject returned too 
many results.; nested exception is 
com.ibatis.common.jdbc.exception.NestedSQLException: 

I already posted a proposal for a patch in the developer-mailing-list.....the 
main problem is, that iBatis checks, whether the resultMap is an implementation 
of java.util.Map...if that is true, a queryForObject is called. The javaType is 
never used in this specific code-area.

We now have kind of a workaround with a dummy-domain-object that has only a 
List ("items") as a property but if this problem is solvable with built-in 
iBatis mechanisms we'll take these

-----Ursprüngliche Nachricht-----
Von: Ben Munat [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 10. Februar 2006 17:45
An: [email protected]
Betreff: Re: HashMap of Lists of HashMaps

Ooh, that's a very overloaded use of the acronym "DOM". Most people would think 
"Document Object Model". You might call it a JavaBean instead... heh, though 
that has its own perils. ;-)

Anyway, I take it the problem is that the resultMap is working with the 
JavaBeans (A and
AA) but not with HashMap. What's the error, Stefan?

b

Nils Winkler wrote:
> Domain Object Model...
> 
> On Fri, 10 Feb 2006 08:06:28 -0700, "Larry Meadors"
> <[EMAIL PROTECTED]> said:
> 
>>What do you mean by DOM?
>>
>>Larry
>>
>>
>>On 2/9/06, Ext_Friedrich, Stefan <[EMAIL PROTECTED]> wrote:
>>
>>>
>>>Hello.
>>>
>>>We encountered a little problem that we are not able to solve by ourselves:
>>>
>>>What we want to do is: Use HashMaps instead of DOM in the resultMapping.
>>>Here's a sample of what we want to do:
>>>
>>><resultMap id="a" class="java.util.HashMap">
>>>        <result property="aa" select="loadAA"/>
>>>        <result property="id" column="id"/> </resultMap> <select 
>>>id="loadA" resultMap="a">
>>>        Select id from tableA where id = 1 </select>
>>>
>>><resultMap id="aa" class="java.util.HashMap">
>>>        <result property="id" column="id"/> </resultMap> <select 
>>>id="loadAA" resultMap="aa">
>>>        Select id from tableA
>>></select>
>>>
>>>The first select returns one result --> a HashMap, the second select 
>>>returns numerous results --> n HashMaps that should be mapped as a List of 
>>>HashMaps.
>>>
>>>When we implement it as a DOM and exchange the classes in the 
>>>resultMaps with the ones below, the same code works fine:
>>>
>>>class A {
>>>        private Collection aa;
>>>        private int id;
>>>        //getters and setters
>>>}
>>>
>>>class AA {
>>>        private int id;
>>>}
>>>
>>>Is there a solution for our problem, because we want to avoid the use 
>>>of a DOM due to flexibility-reasons
>>>
>>>Thanks
>>>Stefan Friedrich
> 
> --
> ==================================
> [EMAIL PROTECTED]
> 

Reply via email to