今天遇到一个特别奇怪的问题,最后发现是自己对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. C# Winform程序把引用的dll放到指定目录

    如果项目引用了很多dll,发布的时候放同一目录会很乱,这时候可以用privatePath后面指定搜索的dll文件夹,多个用;分隔 另外,发现在配置文件夹中 configSource 也是可以指定目录的 ...

  2. 初学C#和MVC的一些心得,弯路,总结,还有教训(1)--语言的选择

    因为惰性,自制力,求知欲等各方面原因....一直没有学新技术,总感觉VB6凑合能用就凑合用.... 于是大概从05年开始,几乎每次新版的vs一发布,我就下载回来,然后安装,然后,,,,就扔那了.... ...

  3. [LeetCode] The Skyline Problem

    A city's skyline is the outer contour of the silhouette formed by all the buildings in that city whe ...

  4. <转>卷积神经网络是如何学习到平移不变的特征

    After some thought, I do not believe that pooling operations are responsible for the translation inv ...

  5. MVC5 + EF6 + Bootstrap3 (16) 客户端验证

    Slark.NET-博客园 http://www.cnblogs.com/slark/p/mvc5-ef6-bs3-get-started-client-side-validation.html 系列 ...

  6. 【原】Learning Spark (Python版) 学习笔记(二)----键值对、数据读取与保存、共享特性

    本来应该上周更新的,结果碰上五一,懒癌发作,就推迟了 = =.以后还是要按时完成任务.废话不多说,第四章-第六章主要讲了三个内容:键值对.数据读取与保存与Spark的两个共享特性(累加器和广播变量). ...

  7. Android studio下使用SharedSDK

      原贴出自:http://bbs.mob.com/thread-5148-1-1.html   首先新建了一个项目用来演示集成ShareSDK 下载好了ShareSDK之后,我们按照下面的步骤使用快 ...

  8. Androidstudio安装AVD出现no system images installed for this target解决方案

    解决方案:

  9. Android drawableleft drawableTop 设置图片的大小

    例子: Drawable drawable=getResources().getDrawable(R.drawable.xx); //获取图片 drawable.setBounds(left, top ...

  10. 我的.NET自学之路

    我第一门语言接触的并不是.net,而是php刚学php感觉还好,但是一学到后面就有一点头晕乎乎的,我感觉没有一个好的编写php代码的编辑器.而且php是弱类型语言,感觉起来没有像c,java,c#这些 ...