You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by anita m <an...@yahoo.com> on 2006/03/31 02:21:41 UTC

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