sqlsession的四大对象

四大对象:
Executor:执行器,用来调度StatementHandler、ParameterHandler、ResultHandler等来执行对应的SQL。
StatementHandler:使用数据库的Statement执行操作,是四大对象的核心。
ParameterHandler:用于对SQL参数的处理。
ResultSetHandler:进行最后数据集ResultSet的封装返回处理的。

一、Executor
真正执行Java和数据库交互的东西,在Mybatis中存在三种执行器:
  • SimpleExecutor:简易执行器,默认的执行器。
  • ReuseExecutor:一种执行器重用预处理语句
  • BatchExecutor:这个执行器会批量执行所有更新语句。

猜你喜欢

转载自www.cnblogs.com/leduo-zuul/p/10684971.html
今日推荐