ityuancom
  1. 找到类:MappedStatement

  2. 在如下代码块打上断点:

 

public BoundSql getBoundSql(Object parameterObject) {
    BoundSql boundSql = sqlSource.getBoundSql(parameterObject);
    List<ParameterMapping> parameterMappings = boundSql.getParameterMappings();
    if (parameterMappings == null || parameterMappings.size() <= 0) {
      boundSql = new BoundSql(configuration, boundSql.getSql(), parameterMap.getParameterMappings(), parameterObject);
    }

    // check for nested result maps in parameter mappings (issue #30)
    for (ParameterMapping pm : boundSql.getParameterMappings()) {
      String rmId = pm.getResultMapId();
      if (rmId != null) {
        ResultMap rm = configuration.getResultMap(rmId);
        if (rm != null) {
          hasNestedResultMaps |= rm.hasNestedResultMaps();
        }
      }
    }

    return boundSql;
  }

 

其中:boundSql 属性可以直接看执行的sql

分类:

技术点:

相关文章:

  • 2021-11-27
  • 2021-06-13
  • 2022-12-23
  • 2021-07-18
  • 2021-11-29
  • 2021-09-04
  • 2021-06-06
猜你喜欢
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-07-09
  • 2021-06-18
  • 2021-04-18
相关资源
相似解决方案