1. 程式人生 > >mybatis 從3.2.8升級到3.4.5,攔截器 SqlInterceptor需要改動的地方

mybatis 從3.2.8升級到3.4.5,攔截器 SqlInterceptor需要改動的地方

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

深圳逆時針