“ mybatis-mp - 亮点八:mybatis-xml returnType 的 ORM 映射 ”
mybatis-mp - 亮点八: 可对 xml 实体类返回 进行自动映射 当你需要写一个很复杂的sql时,你可能会选择用xml 去做例如
<select id="findUserList" returnType="User">
select id,user_name as userName,nick_name as nickName,password from user where xx and xx2 and xx3 ........
</select>
如上你可能需要自己 一个一个 as userName , as nickName 之类的,是不是很麻烦 现在好,只要接入 mybatis-mp这些完全不用写了,如下
<select id="findUserList" returnType="User">
select id,user_name,nick_name,password from user where xx and xx2 and xx3 ........
</select>
自动帮你进行了映射,而且不仅仅支持实体,还支持VO省去了很多麻烦步骤!
推荐阅读
每日一言
"<!doctype html> <html lang="Zh-cn"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="robots" content="noindex,nofollow"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> <meta name="renderer" content="webkit"> <title>您请求的文件不存在!</title> <link type="text/css" rel="stylesheet" href="https://www.oick.cn/css/404.css" /> <link rel="shortcut icon" href="http://www.oick.cn/favicon.ico" type="image/x-icon" /> </head> <body> <div id="wrap"> <div> <img src="https://www.oick.cn/imgs/404.png" alt="404" /> </div> <div id="text"> <strong> <span></span> <a href="javascript:history.back()">返回上一页</a> </strong> </div> </div> <div class="animate below"></div> <div class="animate above"></div> </body> </html>"