mybatis 從3.2.8升級到3.4.5,攔截器 SqlInterceptor需要改動的地方
阿新 • • 發佈:2018-12-26
SqlInterceptor implements Interceptor
需要改動的點
@Intercepts({ @Signature(type = StatementHandler.class, method = "prepare", args = { Connection.class }) })
增加Integer引數
@Intercepts({ @Signature(type = StatementHandler.class, method = "prepare", args = { Connection.class , Integer.class}) })
MetaObject metaStatementHandler = MetaObject.forObject(statementHandler, new DefaultObjectFactory(), new DefaultObjectWrapperFactory());
增加new DefaultReflectorFactory()引數
MetaObject metaStatementHandler = MetaObject.forObject(statementHandler, new DefaultObjectFactory(), new DefaultObjectWrapperFactory(),new DefaultReflectorFactory());
mybatis 3.4.X以上StatementHandler中的prepare入參增加了Integer transactionTimeout