【1】MyBatis Plus插件 MyBatis Plus提供了分页插件PaginationInterceptor、执行分析插件SqlExplainInterceptor、性能分析插件PerformanceInterceptor以及乐观锁插件OptimisticLockerInterceptor。 Mybatis 通过插件 (Interceptor) 可以做到拦截四大对象相关方法的执行 ,根据需求完成相关数据的动态改变。注意,这句话是核心哦。 Executor StatementHandler ParameterHandler ResultSetHandler 四大对象的每个对象在创建时,都会执行interceptorChain.pluginAll(),会经过每个插件对象的 plugin()方法,目的是为当前的四大对象创建代理。代理对象就可以拦截到四大对象相关方法的执行,因为要执行四大对象的方法需要经过代理 。四大插件对各自感兴趣的对象、方法、参数如下 如下所示: @Bean注解向容器中注入bean,这里以分页插件为例:...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with bw.getWrapped
Contact bw.getWrapped, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack