Mybatis-Plus源码-自增主键填充到实体

 

复制代码
#mybatis-3.5.10 + mybatisPlus-3.5.2
#mybatis-plus自增id策略下何时填充id到实体
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl#saveOrUpdate 
  com.baomidou.mybatisplus.extension.service.IService#save
    com.baomidou.mybatisplus.core.override.MybatisMapperProxy#invoke
      com.baomidou.mybatisplus.core.override.MybatisMapperProxy.PlainMethodInvoker#invoke
        com.baomidou.mybatisplus.core.override.MybatisMapperMethod#execute
           org.mybatis.spring.SqlSessionTemplate#insert(java.lang.String, java.lang.Object)
             org.apache.ibatis.executor.CachingExecutor#update
               org.apache.ibatis.executor.SimpleExecutor#doUpdate
                 org.apache.ibatis.session.Configuration#newStatementHandler
                   com.baomidou.mybatisplus.core.MybatisParameterHandler#process   #填充主键id-非自增
                        com.baomidou.mybatisplus.core.MybatisParameterHandler#populateKeys 
                          org.apache.ibatis.session.Configuration#newResultSetHandler
                            org.apache.ibatis.executor.SimpleExecutor#prepareStatement  #获取连接
                              com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor#intercept  #执行拦截器
                                org.apache.ibatis.executor.statement.BaseStatementHandler#prepare  
                                  org.apache.ibatis.executor.statement.PreparedStatementHandler#instantiateStatement #打印sql语句
                                    org.apache.ibatis.executor.statement.PreparedStatementHandler#update
                                      com.zaxxer.hikari.pool.ProxyPreparedStatement#execute
                                        org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator#processBatch
                                          org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator#assignKeys
                                            org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator.KeyAssigner#assign #填充主键id-自增
                                    
              
复制代码

 

posted @   Peter.Jones  阅读(30)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 推荐几款开源且免费的 .NET MAUI 组件库
· 实操Deepseek接入个人知识库
· 易语言 —— 开山篇
· Trae初体验
历史上的今天:
2021-08-02 增强mybatis-plus的typeHandler,可以支持List<T> 中嵌套对象
2019-08-02 Hibernate映射之数组属性, 集合属性(list、set和map)
2019-08-02 Hibernate---实体类注释简介
2019-08-02 org.hibernate.type.SerializationException: could not deserialize 反序列化失败
2019-08-02 多对一和一对多
点击右上角即可分享
微信分享提示