zoukankan      html  css  js  c++  java
  • mybatis的执行流程

     

    MapperRegistry中保存了Mapper对应的动态代理对象

    MapperProxy 生成对应的代理对象,代理的interface是SqlSession,实现有两种SqlSessionManager和DefaultSqlSession。默认是DefaultSqlSession。
    DefaultSqlSession的实在获取Session的时候生成的。
     
    sessionFactory.openSession();返回的是DefaultSqlSession。
     
     
    
    
     
    具体的执行是由StatementHandler执行。
    public int update(String statement, Object parameter) {
        int var4;
        try {
            this.dirty = true;
            MappedStatement ms = this.configuration.getMappedStatement(statement);
            var4 = this.executor.update(ms, this.wrapCollection(parameter));
        } catch (Exception var8) {
            throw ExceptionFactory.wrapException("Error updating database.  Cause: " + var8, var8);
        } finally {
            ErrorContext.instance().reset();
        }

        return var4;
    }
     
     
    this.executor中得到上次获取的executor对象
     
  • 相关阅读:
    chrome:禁用缓存
    datatables:如何禁用一列的排序
    springboot:集成fastjson(教训)
    eclipse:显示堆内存
    模板, 保存&发布
    动画
    配色
    图示 Smart-Art
    常用快捷键 & BLOG & Website
    图表
  • 原文地址:https://www.cnblogs.com/wangjiuyong/p/7162598.html
Copyright © 2011-2022 走看看