在spring中配置mybatis 中自定义的拦截器插件

来源:互联网 发布:php 模拟http 编辑:程序博客网 时间:2024/06/08 16:17

我自己在mybatis 中自定义了一个分页拦截器,在mabatis中是这么注册的

<plugins>       <plugin interceptor="com.as.interceptor.PageInterceptor">           <property name="databaseType" value="mySql"/>       </plugin>    </plugins>

但是如果用spring中配置: 

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">        <!-- SqlSessionFactory的数据源 -->                                                                                                                           <property name="dataSource" ref="dataSource" />         <!-- 配置typeAliasesPackage -->                                                                                                                           <!-- typeAliasesPackage包路径配置 -->                                                                                                                       <property name="typeAliasesPackage" value="com.example.model" />        <!-- 配置Mybatis的插件plugin-->         <property name="plugins">                <array>                       <bean class="com.example.mybatis.plugins.XXXPlugin">                                                                                                          <property name="properties">                                                                                                                                          <value>  property-key=property-value </value>                               </property>                         </bean>                </array>          </property> </bean>


1 0
原创粉丝点击