
mybatis
文章平均质量分 51
tszxlzc
这个作者很懒,什么都没留下…
展开
-
mybatis plus踩坑
使用mybatis plus 框架的com.baomidou.mybatisplus.core.mapper.BaseMapper#insert 保存失败了,这也跟保存方法有关, 因为对象没有赋任何值,没有注解时框架会默认生成id,加了注解后等于所有字段都是空,就会报语法错误。场景是不使用数据库自增id时 没有问题,加了使用自增数据库id就报错,一时也是很懵逼。看这个sql ,当所有字段为空时,可不就会报错吧。原创 2023-08-03 19:27:19 · 594 阅读 · 0 评论 -
TKmybatis 空指针异常
2020-06-16 22:05:15.706 INFO [bootstrap,fda5efa790a39879,dbdeebe931e3b033,false] 16573 --- [XNIO-2 task-1] c.sendinfo.yearcard.biz.YearCardTeamBiz : 查询团队开卡异常java.lang.NullPointerException: null at org.apache.ibatis.binding.MapperMethod.executeFo原创 2020-06-17 15:10:16 · 555 阅读 · 0 评论 -
springboot mybatis 自动配置
先看自动配置类MybatisAutoConfiguration配置了几个重要的bean通过SqlSessionFactoryBean 工厂bean配置SqlSessionFactorySqlSessionTemplateMapperScannerRegistrarNotFoundConfiguration 导入AutoConfiguredMapperScannerRegistrar...原创 2020-02-16 19:15:49 · 1176 阅读 · 0 评论 -
mybatis批量更新两种写法执行性能的对比
多个update语句<update id="updateStudentUnreadLabelForEach"> <foreach collection="subjectiveSharedLabelCountDTOList" item="item" separator=";"> update h_homework_student_copy set原创 2019-01-30 14:52:31 · 1954 阅读 · 0 评论 -
mybatis的mapper代理是怎么生成的
在spring配置中引入MapperScannerConfigurer bean,这个bean是入口,一般配置方法是 &amp;amp;lt;bean class=&amp;quot;org.mybatis.spring.mapper.MapperScannerConfigurer&amp;quot;&amp;amp;gt; &amp;amp;lt;property name=&amp;quot;原创 2019-01-30 17:41:38 · 675 阅读 · 0 评论 -
spring boot自动化配置druid + mybatis
先添加maven配置 <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <dependency> <groupId&g...原创 2019-04-08 14:51:48 · 539 阅读 · 0 评论