记一次MyBatis分页莫名其妙的失效,首次执行合适,后续执行分页失效且异常

代码几乎一样,为啥这个xml配置的就会出现莫名其妙的问题呢

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='mybatis_plus_first', mode=IN, javaType=long, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #3 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2).

at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:97)

at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439)

at com.sun.proxy.$Proxy131.selectList(Unknown Source)

at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224)

at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForIPage(MybatisMapperMethod.java:121)

at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:85)

at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152)

at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)

at com.sun.proxy.$Proxy237.getSearchIndexByPage(Unknown Source)

at com.bigdatacd.panorama.system.service.impl.SearchIndexServiceImpl.getSearchIndexByPage(SearchIndexServiceImpl.java:31)

at com.bigdatacd.panorama.system.service.impl.SearchIndexServiceImpl$$FastClassBySpringCGLIB$$bb45ed4a.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:792)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762)

at com.baomidou.dynamic.datasource.aop.DynamicDataSourceAnnotationInterceptor.invoke(DynamicDataSourceAnnotationInterceptor.java:57)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762)

at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:707)

at com.bigdatacd.panorama.system.service.impl.SearchIndexServiceImpl$$EnhancerBySpringCGLIB$$3684ef87.getSearchIndexByPage(<generated>)

at com.bigdatacd.panorama.system.controller.SearchIndexController.getSearchIndexByPage(SearchIndexController.java:40)

at com.bigdatacd.panorama.system.controller.SearchIndexController$$FastClassBySpringCGLIB$$cc3a314a.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

最后,发现xml的注释 如-- 这样的会引起解析分页失败好吧,不追究了奇奇怪怪的问题

相关推荐
bing_1589 小时前
MyBatis XMLMapperBuilder 是如何将 SQL 语句解析成可执行的对象? 如何将结果映射规则解析成对应的处理器?
mybatis
玖伴_11 小时前
【Java】Mybatis学习笔记
java·学习·mybatis
韧竹、16 小时前
JavaEE介绍及Springboot入门
java·spring·mybatis
梦想歌16 小时前
一招搞定! 自定义MyBatis拦截器,SQL日志存储成本直降30%
spring boot·mybatis
梦想歌17 小时前
告别手动赋值!优雅处理 MyBatis-Plus 的创建时间和更新时间
mysql·mybatis
张小娟17 小时前
springCloud集成tdengine(原生和mapper方式) 其一
spring cloud·mybatis·tdengine
stayhungerstayflush21 小时前
Spring Boot集成MyBatis与MySQL
spring boot·mysql·mybatis
bing_1581 天前
MyBatis 配置文件解析使用了哪些设计模式
mybatis
小丁爱养花1 天前
Web 小项目: 网页版图书管理系统
java·spring·mybatis