![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Mybatis
文章平均质量分 55
一大三千
一入IT深似海,且行且编码!
展开
-
Mybatis使用注解的方式CRUD包括批量插入更新
定义一个Mapper接口:@Mapper@Repositorypublic interface ConfigMapper {}查询注解@Select:@Select("select * from config where id=#{id}")Config findById(Long id);删除注解@Delete:@Delete("delete from config where id=#{原创 2017-10-17 16:41:06 · 12095 阅读 · 2 评论 -
解决由于设置BatchExecutor批量执行器而导致无法获取自增Id的问题
在Mybatis中有三种Executor: - SimpleExecutor – SIMPLE 就是普通的执行器。 - ReuseExecutor -执行器会重用预处理语句(prepared statements) - BatchExecutor –它是批量执行器这些就是Mybatis的三种执行器。你可以通过配置文件的settings里面的元素defaultExecutorType,配置它,默原创 2017-11-02 13:31:06 · 3144 阅读 · 0 评论 -
Mybatis插件开发原理
Mybatis插件说明MyBatis 允许你在已映射语句执行过程中的某一点进行拦截调用。默认情况下,MyBatis 允许使用插件来拦截的方法调用包括:Executor (update, query, flushStatements, commit, rollback, getTransaction, close, isClosed)ParameterHandler (getParameterOb原创 2017-10-19 08:52:30 · 702 阅读 · 0 评论 -
【开源项目】Dynamic-add-date的使用
介绍Dynamic-add-date是基于Mybatis插件原理开发的可以动态在Insert和Update Sql语句中添加日期列和对应的值的插件。 要求Maven支持jdk7及之后的版本MySql(其它数据库暂未测试)功能自定义要生成的日期列的名称自动处理原始Sql语句中已包含自定义日期列名支持批量插入、批量更新Sql日期列的生成支持忽略表,表名支持正原创 2018-01-31 17:18:24 · 482 阅读 · 0 评论 -
Fix:Skipping MapperFactoryBean with name ‘xxxMapper' mapperInterface
解决Spring Boot应用整合Mybatis启动输出警告日志:[main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'channelMapper' and 'io.github.yidasanqian.dao.ChannelMapper' mapperInterface. Bean ...原创 2019-04-01 17:15:46 · 15098 阅读 · 0 评论