Java Mailing List Archive

http://www.java2.5341.com/

Home » user-java.ibatis »

resultType="list" contains null values

JohannesK

2010-05-20

Replies: Find Java Web Hosting

Author LoginPost Reply

Hello

I am having the weirdest problem with Ibatis 3. Here is my mapper XML:

   <select id="verify" resultType="list">
   SELECT table_name.id_column
   FROM table_name
   WHERE table_name.other_column = #{parameter_id}
   AND table_name.id_column IN
   <foreach item="id" index="index" collection="parameter_ids" open="("
separator="," close=")">
     #{id}
   </foreach>
 </select>

Mapper Java looks like this:

  public List verify(
       @Param("parameter_id") Long customerId,
       @Param("parameter_ids") Long... ids);

The log tells me this:

13:48:11 DEBUG [Slf4jImpl] - <==> Executing: SELECT table_name.id_column
FROM table_name WHERE table_name.other_column = ? AND table_name.id_column
IN ( ? , ? ) >
13:48:11 DEBUG [Slf4jImpl] - <==> Parameters: 1(Long), 71(Long), 78(Long)>
13:48:11 DEBUG [Slf4jImpl] - <<==   Columns: id_column>
13:48:11 DEBUG [Slf4jImpl] - <<==     Row: 71>
13:48:11 DEBUG [Slf4jImpl] - <<==     Row: 78>
13:48:11 DEBUG [Slf4jImpl] - <xxx Connection Closed>


The query seems to be in order and the result (based on the log) is the
right one. However, the resulting List that I receive from the mapper
contains two null values instead.

Anyone have any ideas what's going on here?

table and column names have been replaced, please excuse any mistakes
--
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@(protected)
For additional commands, e-mail: user-java-help@(protected)

©2008 java2.5341.com - Jax Systems, LLC, U.S.A.