多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## 实例 ~~~ <resultMap id="userAccount" type="com.like.domain.User"> <id property="id" column="id"/> <result property="username" column="username"/> <result property="sex" column="sex"/> <result property="birthday" column="birthday"/> <result property="address" column="address"/> <collection property="accounts" ofType="com.like.domain.Account"> <id property="id" column="aid"/> <result property="uid" column="uid"/> <result property="money" column="money"/> </collection> </resultMap> <select id="findUserAccount" resultMap="userAccount"> select u.*,a.id as aid,a.uid,a.money from user u left outer join account a on u.id = a.uid; </select> ~~~ ~~~ IUserDao mapper = session.getMapper(IUserDao.class); List<User> userAccount = mapper.findUserAccount(); for (User user : userAccount) { System.out.println(user); } ~~~