首页 > 其他 > 详细

myBatis外部的resultMap高级应用

时间:2017-08-19 20:41:05      阅读:282      评论:0      收藏:0      [点我收藏+]

resultMap:外部的resultMap的引用,和resultType不能同时使用。

  <resultMap id="BaseResultMap" type="com.lamsey.survey.entities.guest.User" >
    <id column="user_id" property="userId" jdbcType="INTEGER" />
    <result column="user_name" property="userName" jdbcType="CHAR" />
    <result column="user_pwd" property="userPwd" jdbcType="CHAR" />
    <result column="company" property="company" jdbcType="BIT" />
  </resultMap>
<!-- 根据用户名查询用户信息 -->
  <select id="selectUser" resultMap="BaseResultMap">
      select user_id, user_name, user_pwd, company
    from guest_user where user_name = #{userName,jdbcType=CHAR}
  </select>

 

myBatis外部的resultMap高级应用

原文:http://www.cnblogs.com/limingxian537423/p/7397717.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!