如何用annotation 注解方式加载 mybatis interceptor

项目中用到了mybatis interceptor。 如果是用xml方式加载interceptor,可以是这样:

<plugins>
    <plugin interceptor="com.foo.FooInterceptorForQry"></plugin>
</plugins>

但是项目用了spring boot, 没有xml。 这种情况下如何用annatation 注解方式加载mybatis 注解呢?

阅读 7.4k
2 个回答

不好意思。我重新翻看了源码,,没有发现可以在yml文件中配置interceptor的属性。
看来目前只能通过

mybatis:
  config-location: classpath:mybatis-config.xml

指定配置文件路径了。。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进