ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rencelj Marco" <renc...@cad.it>
Subject RE: Error in using an ArrayList type as resultClass in IBatis for .net
Date Fri, 11 Nov 2005 10:34:09 GMT
Thanks Gilles,

 

But what about this:

 

            <select id="GetAllDocumentPlain" class="ArrayList">

                  select 

                        *

                  from Documents 

                  order by Document_Type, Document_Id

            </select>

 

Or

 

            <select id="GetAllDocumentPlain">

                  select 

                        *

                  from Documents 

                  order by Document_Type, Document_Id

            </select>

 

???

 

Where's my error?

 

thanks

 

________________________________

From: Gilles Bayon [mailto:ibatis.net@gmail.com] 
Sent: Friday, November 11, 2005 9:30 AM
To: user-cs@ibatis.apache.org
Subject: Re: Error in using an ArrayList type as resultClass in IBatis
for .net

 

If you want to get an ArrayList, you don't need to specify the
resultClass. The listClass attribut is used for typed collection.

 

Sample from unit test

<select id="GetAllDocument"
   resultMap="document">
   select 
    *
   from Documents 
   order by Document_Type, Document_Id
  </select>

 

IList list = sqlMap.QueryForList("GetAllDocument", null);
 

On 11/11/05, Rencelj Marco <rencelj@cad.it> wrote: 

I had to get a list with a variable number of columns so I had to try
ArrayList as resultClass (columns are unnamed).

The ArrayList is populated with a correct number of rows but each row
instance is an empty ArrayList.

I fixed the problem in source code adding a code fragment in
MappedStatement.cs as in included code.

Anybody had the same problem? May be there is a release that include
this fix ...

Thanks in advane

Marco


Mime
View raw message