Skip to content

Conversation

@kazuki43zoo
Copy link
Member

I've supported to specify a custom MapperFactoryBean on <mybatis:scan>(MapperScannerBeanDefinitionParser) and MapperScannerConfigurer because support factoryBean attribute at @MapperScan.

@MapperScan (Already supported in 2.0.0 or before) :

@MapperScan(basePackages = "x.y.z.mapper", factoryBean = CustomMapperFactoryBean.class)
public class DataAccessConfiguration {
  // ...
}

XML namespace (Will support since 2.0.1):

<mybatis:scan base-package="x.y.z.mapper"
                mapper-factory-bean-class="x.y.z.mapper.CustomMapperFactoryBean"/>

MapperScannerConfigurer (Will support since 2.0.1):

<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  <property name="basePackage" value="x.y.z.mapper" />
  <property name="mapperFactoryBeanClass" value="x.y.z.mapper.CustomMapperFactoryBean" />
  <!-- ... -->
</bean>

@kazuki43zoo kazuki43zoo self-assigned this Mar 31, 2019
@kazuki43zoo kazuki43zoo added the enhancement Improve a feature or add a new feature label Mar 31, 2019
@kazuki43zoo kazuki43zoo added this to the 2.0.1 milestone Mar 31, 2019
@kazuki43zoo kazuki43zoo merged commit e245bbf into mybatis:master Mar 31, 2019
@kazuki43zoo kazuki43zoo deleted the allow-custom-mapper-factory-bean-class-on-namespace branch March 31, 2019 04:48
kazuki43zoo added a commit to kazuki43zoo/mybatis.github.io that referenced this pull request Mar 31, 2019
pulllock pushed a commit to pulllock/mybatis-spring that referenced this pull request Oct 19, 2023
…actory-bean-class-on-namespace

Allow to specify custom MapperFactoryBean class on xml based bean definition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improve a feature or add a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant