码迷,mamicode.com
首页 > 其他好文 > 详细

关于 Mybatis 的Invalid bound statement (not found):错误

时间:2016-07-14 02:48:49      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:

今天遇到一个特别奇怪的问题,最后发现是自己对mybatis的学习还有待提高

返回类型可以用resultType,也可以用resultMap

resultType是直接表示返回类型的,而resultMap则是对外部ResultMap的引用

举个例子:

resultMap:

<select id="findByContract" resultMap="BaseResultMap">
        select
        *
        from
        user
        where
        tel=#{tel}
    </select>

resultType:

<select id="getCountGroupbyUserSex" resultType="com.iswust.controller.vo.stat.StatUserSexBean">
        select sex as
        type,count(*) as count from user group by sex;
    </select>

<select id="findConnectByid" resultType="java.lang.String">
        select
        tel
        from
        user
        id=#{user_id}
    </select>

 

以后再也不要犯这么愚蠢的错误啦

关于 Mybatis 的Invalid bound statement (not found):错误

标签:

原文地址:http://www.cnblogs.com/boycelee/p/5668568.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!