hashmap resultType and null values

164 views
Skip to first unread message

GregW

unread,
Oct 24, 2011, 9:59:42 AM10/24/11
to mybatis-user
In my xml, I have

<select id="getRecord" parameterType="map" resultType="hashmap">
select
<foreach item="item" collection="columns" separator=",">
${item}
</foreach>
from ${table}
where id = #{id}
</select>

The table is likely to have a large number of columns. When I look at
the hashmap returned, it omits those columns with null values even if
they appear in that foreach statement. Is there anyway to get these
columns which have a null value into my result hashmap?

Richard Yee

unread,
Feb 1, 2013, 8:34:17 PM2/1/13
to mybati...@googlegroups.com
What value do you want returned when a value in a column is null?

Richard


Sent from my iPhone

On Feb 1, 2013, at 1:05 PM, BW <brandon.j...@gmail.com> wrote:

I just came across this strange behavior as well. Did you ever find an explanation/workaround?
--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Eduardo Macarron

unread,
Feb 2, 2013, 12:06:50 PM2/2/13
to mybati...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages