Mybatis通过别名映射复杂对象
2016-07-28 14:15
417 查看
</pre><pre name="code" class="java"><span style="font-family: Arial, Helvetica, sans-serif;">public class Apply {</span>
private int id; private int status; private User user; //setter/getter toString略}
</pre><pre name="code" class="java">public class User { private int id ; private String phone; //setter/getter toString略<pre name="code" class="java">}
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.xxx.IApplyDao"> <select id="getApplications" resultType="com.xxx.Apply"> select apply.`status` as `status` , apply.`id` as `id` , user.id as `user.id`, user.phone as `user.phone` from dy_community_admin_application apply inner join dy_user user on `user`.id=apply.uid where apply.id = 6 </select> </mapper>
相关文章推荐
- UIWindow&UIWindowLevel
- Hadoop/Spark博客
- Servlet(2)
- Xamarin.iOS提供没有匹配的配置文件
- Qt实现顶层窗口特效--阴影和圆角
- KendoUI学习笔记(类图)
- 1024. 科学计数法 (20)
- HDU 1181
- HttpClient Call Website
- Android AIDL使用详解
- Git名词解释积累
- MIDI文件(1)
- SELinux 的启动、关闭与查看
- android 图片压缩
- C++中虚析构函数的作用
- 欢迎使用CSDN-markdown编辑器
- 第37篇 网络(七)TCP(一)
- Xamarin.iOS提供没有匹配的配置文件
- Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag
- 【精】TCP/IP协议简介(一) 之 TCP/IP简介