MapperProxy.invoke
-->获取MapperMethod(创建SqlCommand,MethodSignature对象,MapperMethod的属性)
-->MapperMethod.execute
-->{
switch(SqlCommand)
case insert:
SqlSession.insert break;
case update:
SqlSession.update break;
case delete:
SqlSession.delelte break;
case select:
sqlSession.select or
sqlSession.selectOne or
sqlSession.selectList or
sqlSession.selectCursor or
sqlSession.selectMap break;
}
-->获取MapperStatemnt(<-configuration.getMappedStatement)
-->{
sqlSession.insert or
sqlSession.update or
sqlSession.delete or
执行executor.update;
sqlSession.selectCursor
执行Executor.queryCursor ;
others:
执行Executor.query
}
-->Plugin.invoke
->{
有拦截器:interceptor.intercept
没拦截器:Executor.query or Executor.queryCursor,executor.update
}
->获取BoundSql
->创建CacheKey
->创建StatementHandler
->获取Statement
->handler.query
->ps.execute
->ResultHandler.handleResultSets