LD is tigger forever,CG are not brothers forever, throw the pot and shine forever.
Modesty is not false, solid is not naive, treacherous but not deceitful, stay with good people, and stay away from poor people.
talk is cheap, show others the code,Keep progress,make a better result.
Survive during the day and develop at night。
目录
概 述
public SimpleExecutor(Configuration configuration, Transaction transaction) {
super(configuration, transaction);
}
实例化完成以后:实例化完成以后,执行方法调用doQuery
@Override
public <E> List<E> doQuery(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
.......
}
我们可以看到这个方法是 @Override 重写父类的方法 ,去它的父类BaseExecutor看下该方法
BaseExecutor##doQuery
protected abstract <E> List<E> doQuery(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql)
throws SQLException;
获取大管家 Configuration
每次都要newStatementHandler ,这个StatementHandler 后面我们重点将,是专门处理JDBC的
prepareStatement --> BaseStatementHandler #prepare 方法
调用SimpleStatementHandler#query
总结:
相关工具如下:
分析:
小结:
主要讲述了接下来实例化SimpleExecutor详解,请大家指正~
参考资料和推荐阅读
1.链接: 参考资料.