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对象
     
  • 相关阅读:
    Oracle ASH报告生成和性能分析
    Oracle AWR报告生成和性能分析
    oracle和mysql批量合并对比
    Oracle
    Delphi
    Delphi
    Delphi
    Delphi
    Delphi
    Delphi
  • 原文地址:https://www.cnblogs.com/wangjiuyong/p/7162598.html
Copyright © 2011-2022 走看看