zoukankan      html  css  js  c++  java
  • mybatis常见错误汇总

    1、Result Maps collection does not contain value for 

    Caused by: org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.business.entity.RepayChannel
    at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementResultMap(MapperBuilderAssistant.java:346)
    at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:284)
    at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:107)
    at org.apache.ibatis.session.Configuration.buildAllStatements(Configuration.java:698)
    at org.apache.ibatis.session.Configuration.hasStatement(Configuration.java:668)
    at org.apache.ibatis.session.Configuration.hasStatement(Configuration.java:663)
    at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:180)
    at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43)
    at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)
    at com.sun.proxy.$Proxy29.selectResourcess(Unknown Source)
    at com.cardniu.ccrepayment.service.system.impl.ResourcesServiceImpl.selectResourcess(ResourcesServiceImpl.java:99)
    at com.cardniu.ccrepayment.service.system.impl.ResourcesServiceImpl$$FastClassBySpringCGLIB$$fd86be84.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:43)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)
    at com.cardniu.ccrepayment.service.system.impl.ResourcesServiceImpl$$EnhancerBySpringCGLIB$$2309954f.selectResourcess(<generated>)
    at com.cardniu.ccrepayment.shiro.ChainDefinitionSectionMetaSource.getObject(ChainDefinitionSectionMetaSource.java:39)
    at com.cardniu.ccrepayment.shiro.ChainDefinitionSectionMetaSource.getObject(ChainDefinitionSectionMetaSource.java:1)
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
    ... 29 more
    Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for com.business.entity.RepayChannel
    at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:797)
    at org.apache.ibatis.session.Configuration.getResultMap(Configuration.java:550)
    at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementResultMap(MapperBuilderAssistant.java:344)
    ... 55 more

    原因:resultType写成resultMap

    resultMap后面接mapper.xml定义的列集合,

    resultType后面才能接具体的类

    <select id="selectChannel" resultMap="com.business.entity.RepayChannel">

  • 相关阅读:
    解决webstorm中vue语法没有提示
    Vue.js devtool插件下载安装及后续问题解决
    一张900w的数据表,怎么把原先要花费17s执行的SQL优化到300ms?
    liunx启动出现 pcntl_fork() has been disabled for security reasons
    【转】linux防火墙配置
    PHP-mysqli 出错回显
    【转】msfvenom使用指南
    【转】验证码绕过
    Windows提权与开启远程连接
    【转】kali安装w3af
  • 原文地址:https://www.cnblogs.com/xingyyy/p/7229666.html
Copyright © 2011-2022 走看看