![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mybatis
p393975269
甜蜜大橙
展开
-
mybatis-plus高级功能之实现自定义通用方法
MP在一开始就给大家提供了很多通用的方法,在DefaultSqlInjector这个类中,在MethodList这个集合当中包含的都是通用方法类,如果想要使用自定义通用方法,也需要添加到这个集合当中。CustomSqlMethod是自定义的枚举类,我在下面已经贴出来了,这样可以使代码更优雅,我没有选择用官方提供的SqlMethod,是因为我怕到时候不容易维护。继承AbstractMethod抽象类,AbstractMethod是抽象的注入方法类,每个通用方法也都继承了这个类,也是为了方便调用里面的方法。原创 2024-06-25 14:43:16 · 420 阅读 · 0 评论 -
mybatis xml中List<List<String>> 使用foreach嵌套遍历
话不多说,直接上代码。原创 2024-02-02 09:35:42 · 642 阅读 · 0 评论 -
利用Mybatis-plus实现公共字段的自动填充
利用Mybatis-plus实现公共字段的自动填充原创 2023-01-04 11:13:46 · 66 阅读 · 0 评论 -
nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping
今天mybatis报了个错误org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=‘InfoId’, mode=IN, j...原创 2020-01-15 19:47:43 · 983 阅读 · 0 评论 -
Parameter index out of range (3 > number of parameters, which is 2)
Caused by: java.util.concurrent.ExecutionException: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=‘idType’, mode=IN, javaType=class java.lang.St...原创 2020-01-15 19:47:02 · 835 阅读 · 0 评论 -
mybatis 出现java.lang.reflect.UndeclaredThrowableException异常
遇到这个问题的应该都是以下操作:mybatis的mapper文件的属性和实体类的属相不一致导致反射出错原因:1.如字面意思:实体类之间的属性不一致,请仔细检查。2.属性的修饰符也要检查(我的就是这个问题)3.getter/setter方法没写。我今天遇到的是mapper中的字段和数据库的没对应上...原创 2019-09-06 10:32:36 · 6041 阅读 · 0 评论