1

This is my interface method:

HashMap<String,Object> getUserById(int id);

and this is my XML method:

<select id="getUserById" parameterType="int" resultType="hashmap" >  
        select * from users where user_id = #{user_id}
    </select>

then I use the Junit to test it,this is my Junit case:

@Test
    public void testGetUsers() 
    {
            HashMap<String,Object> maps = new HashMap<String, Object>();
            int id = 5;
        maps = mapper.getUserById(id);
        System.out.println(maps);
        Assert.assertNotNull(maps);
    }

then I got the result like this:

{DEPARTMENT_ID=1, phone=3423456, NAME=张飞, USER_ID=5, department_id=1, password=1111, PHONE=3423456, username=zhangfei, email=zhangfei@qq.com, MOBILE=12345678963, name=张飞, user_id=5, USERNAME=zhangfei, EMAIL=zhangfei@qq.com, PASSWORD=1111, mobile=12345678963}

as you see,the result contains uppercase and lowercase,but I dosen't want to the uppercase,how to do it?

Tsangyang chen
  • 111
  • 1
  • 2
  • 5

1 Answers1

0

Try to enforce the lowercase in the query

select MY_COLUMN as from my_column ...

If that doesn't work, take a look to this answer.

Community
  • 1
  • 1
jddsantaella
  • 3,657
  • 1
  • 23
  • 39