ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raúl Arabaolaza Barquín <raul.arabaol...@mundivia.net>
Subject RE: how can I map an array property in the resultset ?
Date Fri, 31 Mar 2006 06:11:33 GMT
I forgot... I believe TypeHandler can´t help you.

Raúl  

-----Mensaje original-----
De: anita m [mailto:anita1766@yahoo.com] 
Enviado el: viernes, 31 de marzo de 2006 2:22
Para: user-java@ibatis.apache.org
Asunto: how can I map an array property in the resultset ?

I have the following classes  
class TestA{ 
TestB[] bObjects;  
Integer id; 
} 
and my sqlmap does this 
1. <resultMap id="alltestAs" class="TestA"
groupBy="id" > 
2. <result name="id" column="TESTA_ID" /> 
3. <result name="bObjects" javaType="TestB[]"
resultMap="bOfA" > 
4. </resultMap> 
5. 
6. <resultMap id="bOfA" class="TestB[]" > 
7. <result name="id" column="TESTB_ID" /> 
8. <resultMap> 
 
I get the following exception 
Could not set TypeHandler. Cause:
java.lang.ClassNotFoundException: TestB[] 
 
In line 3. I tried setting javaType to TestB etc., but
I get errors, how can I map a result set to an array
of objects ? 

After looking through the archives I think I may have
to implement a custom type handler... but am not sure
when/why and how such a beast can be developed
Thankyou

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message