如何用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

指定配置文件路径了。。