where ((username = #{username}) AND (usertype = #{usertype}))
(Remove the ' characters, you don't need or want them.)
Larry
I just tried with the contact_manager_cli sample and it worked fine for
me. The id column is of jdbcType INTEGER.
mapper.xml:
<select id="selectById" resultType="contact" parameterType="map">
select
id, lastName, firstName, phone, email
from contact
where id = #{id}
</select>
mapper.java:
Contact selectById(HashMap hmParams);
test.java:
HashMap hmParams = new HashMap();
hmParams.put("id", 1);
Contact c = mapper.selectById(hmParams);
BTW, with Mybatis 3, you should stop using HashMaps for parameters, and
instead use mapper interfaces with individual parameters. The approach
is much clearer and is type safe.
--
Guy Rouillier
Larry