TDengine
TDengine copied to clipboard
Mybatis mapping error : select last_row(*)
Bug Description 比如:表中有字段 ts,price,qty 。java bean也有对应到属性
使用select last_row(*) from。。。查询
返回的result head是:last_row(ts) last_row(price) last_row(qty)
这个结果无法通过mybatis映射到bean实体
OK, we'll check it.
<resultMap id="lastRowResult" type="javaBeanName">
<result column="last_row(ts)" property="ts"></result>
<result column="last_row(price)" property="price"></result>
<result column="last_row(qty)" property="qty"></result>
</resultMap>
<select id="getLastRow" resultMap="lastRowResult">
select last_row(*) from test.tablename
</select>
这个用mybatis的resultMap就能解决
modify you cfg file config, add keepColumnName 1 ,ref link https://docs.taosdata.com/reference/config/