[mybatis] ask about the case setting of key when resultType is defined as Map

I would like to ask you that when I use mybatis to execute sql to get data, I define the mapping in xml as follows:

<select id="testQry" parameterType="hashmap" resultType="hashmap">
SELECT DISTINCT username FROM t_user WHERE 1=1
</select>

Database version is oracle 12.2.0.1.0 Mybatis version 3.4.2
key=USERNAME in Map after execution. Actually, all column fields in the table are lowercase. Online search is mostly recommended to use aliases when writing, for example: SELECT DISTINCT username AS "username" FROM t_user WHERE 1,
, but this is very inconvenient to write a lot of SQL aliases. Want to know if there is any configuration that can deal with this problem at once and generate key directly in lowercase?

Apr.15,2022

this is the problem of ORACLE. We have encountered this problem before, and then we don't use map to receive the return value. It is recommended to use a class to save the data you want to get.

Menu