今天遇到一个特别奇怪的问题,最后发现是自己对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):错误的更多相关文章

  1. myBatis中Invalid bound statement (not found)错误

    环境:Idea.ssm.maven 由于使用maven的原因,maven不会扫描到mapper的xml文件所以会出现此类问题. 每次走到mapper方法时就抛异常:Invalid bound stat ...

  2. mybatis提示Invalid bound statement (not found)错误的可能原因

    https://www.cnblogs.com/liaojie970/p/8034525.html

  3. MyBatis: Invalid bound statement (not found)错误的可能原因

    MyBatis: Invalid bound statement (not found)错误的可能原因 其他原因导致此问题解决参考: 1.检查 xml 文件所在 package 名称是否和 Mappe ...

  4. mybatis:Invalid bound statement (not found)

    [常规解决办法] 如果出现: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因 ...

  5. 在使用mybatis的selectFromExample时出现Invalid bound statement (not found)错误

    主要原因:运行项目在构建的时候只会默认的去加载resource资源文件里面的资源,其他地方的配置资源不会加载 .故没有读取到mybatis的MapperXml映射 结构如下 ============= ...

  6. mybatis 报Invalid bound statement(not found) 和 Property 'mapperLocations' was not specified or not matching resources found

    排除问题的步骤: 1.首先检查mapper文件和mapper接口的文件名是否相等. 2.pom.xml是否把xml排除了,这样写就会src/main/java下所有的Mybatis的xml文件都删除, ...

  7. mybatis Invalid bound statement (not found)错误解决办法

    由于新版的IntelliJ IDEA不再编译source folder下的xml文件,而我们平时使用mybatis时,习惯于将*Mapper.xml文件放在与dao层.service层平级的src目录 ...

  8. 解决Mybatis的invalid bound statement (not found)异常

    使用Maven构建SSM时, 需要在pom.xml中配置一些信息, 否则mapper.xml就无法被扫描到, 程序就会抛invalid bound statement (not found)异常 解决 ...

  9. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误几种解决方案

    报错信息: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.study.ser ...

随机推荐

  1. 去除多余的cell 和最后一行cell显示顶头底线

    去除多余cell YourTableview.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; 最后一行cell底线顶头显示 s ...

  2. Linux 进程间通讯详解四

    msgsnd函数 int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); --功能:把一条消息添加到消息队列中 --参数 ...

  3. .NET跨平台之旅:借助ASP.NET 5 Beta5的新特性显示CLR与操作系统信息

    今天在 MSDN 博客上看到了 ASP.NET 5 Beta5 的发布消息(详见 ASP.NET 5 Beta5 Now Available),从中知道了 2 个新特性: 1. DNX: New IR ...

  4. c#编码转换

    /// <summary> /// URL编码 /// </summary> /// <param name="Source"></par ...

  5. sublime编辑器插件

    sublime---插件 http://www.cnblogs.com/dudumao/p/4054086.html sublime--- Emmet插件  使用方法 http://docs.emme ...

  6. 【转】C# lock的使用

    一.Lock定义     lock 关键字可以用来确保代码块完成运行,而不会被其他线程中断.它可以把一段代码定义为互斥段(critical section),互斥段在一个时刻内只允许一个线程进入执行, ...

  7. Html中行内样式的设置

    Html中行内样式的设置.. <html> <head> <title>显示的页面选项卡标题</title> <style type=" ...

  8. 安卓贴图源码--->单点触控.多点触控.类似in/百度魔图

    效果如图: 类似in,百度魔图,的贴图功能  核心的地方:单/多点 旋转缩放后记录各个顶点小图标位置 引用这里 http://blog.csdn.net/xiaanming/article/detai ...

  9. zabbix注入过程分析

    Zabbix jsrpc.php sql 注入过程分析 漏洞公开详情(https://support.zabbix.com/browse/ZBX-11023)中提示在insertDB() 中的inse ...

  10. 学习MySQL之单表操作(二)

    ##单表操作 ##创建表 CREATE TABLE t_employee( empno ), ename ), job ), MGR ), Hiredate DATE DEFAULT '0000-00 ...